Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

Commit 41f27fb

Browse files
committed
Added github actions.
Change-Id: I43fcdbd36408c7f8725d00c4de76a5fb1dde414d
1 parent b735644 commit 41f27fb

File tree

4 files changed

+125
-3
lines changed

4 files changed

+125
-3
lines changed

.github/workflows/release.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "v[0-9]+.[0-9]+.[0-9]+"
6+
- "v[0-9]+.[0-9]+.[0-9]+-rc-[0-9]+"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
id-token: write
14+
packages: write
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@master
18+
- name: Cache Racket dependencies
19+
uses: actions/cache@v2
20+
with:
21+
path: |
22+
~/.cache/racket
23+
~/.local/share/racket
24+
key: ${{ runner.os }}-racket-8.10
25+
- name: Install Racket
26+
uses: Bogdanp/[email protected]
27+
with:
28+
architecture: 'x64'
29+
distribution: 'full'
30+
variant: 'CS'
31+
version: '8.10'
32+
- name: Install Dependencies
33+
run: raco pkg install --auto --skip-installed raco-cross
34+
35+
- name: Set env vars
36+
run: |
37+
echo VERSION=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
38+
echo S_VERSION=${GITHUB_REF#refs/tags/v} >> $GITHUB_ENV
39+
40+
- name: Build Binaries
41+
run: |
42+
cd racket
43+
echo "$S_VERSION" > version.inc
44+
bash build-all.sh
45+
./git-gerrit.x86_64-linux version
46+
47+
- name: Create release body file
48+
run: |
49+
cat <<EOF > ${{ runner.temp }}/body.md
50+
## Binaries
51+
Install Guide: [README.md](${{ github.server_url }}/${{ github.repository }}/blob/$(git rev-parse HEAD)/README.md)
52+
53+
Checksums for all files:
54+
55+
EOF
56+
- name: Generate Sha256sum
57+
run: |
58+
(cd racket
59+
echo "```"
60+
sha256sum git-gerrit.aarch64-macosx git-gerrit.x86_64-linux git-gerrit.x86_64-macosx git-gerrit.x86_64-win32.exe
61+
echo "```" ) >> ${{ runner.temp }}/body.md
62+
- name: Create release
63+
id: create_release
64+
uses: actions/create-release@v1
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
with:
68+
tag_name: ${{ env.VERSION }}
69+
release_name: ${{ env.VERSION }}
70+
commitish: ${{env.COMMITISH }}
71+
body_path: ${{ runner.temp }}/body.md
72+
73+
- name: Upload binary macosx aarch64
74+
uses: actions/upload-release-asset@v1
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
with:
78+
upload_url: ${{ steps.create_release.outputs.upload_url }}
79+
asset_path: racket/git-gerrit.aarch64-macosx
80+
asset_name: git-gerrit.aarch64-macosx
81+
asset_content_type: application/octet-stream
82+
83+
- name: Upload binary macosx x86_64
84+
uses: actions/upload-release-asset@v1
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
with:
88+
upload_url: ${{ steps.create_release.outputs.upload_url }}
89+
asset_path: racket/git-gerrit.x86_64-macosx
90+
asset_name: git-gerrit.x86_64-macosx
91+
asset_content_type: application/octet-stream
92+
93+
- name: Upload binary Linux x86_64
94+
uses: actions/upload-release-asset@v1
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
with:
98+
upload_url: ${{ steps.create_release.outputs.upload_url }}
99+
asset_path: racket/git-gerrit.x86_64-linux
100+
asset_name: git-gerrit.x86_64-linux
101+
asset_content_type: application/octet-stream
102+
103+
- name: Upload binary Windows x86_64
104+
uses: actions/upload-release-asset@v1
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
with:
108+
upload_url: ${{ steps.create_release.outputs.upload_url }}
109+
asset_path: racket/git-gerrit.x86_64-win32.exe
110+
asset_name: git-gerrit.x86_64-win32.exe
111+
asset_content_type: application/octet-stream
112+

racket/build-all.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ set -e
1919
raco test scsh/test.rkt
2020
raco test alvs/test.rkt
2121

22-
for i in x86_64-win32 aarch64-macosx x86_64-macosx x86_64-linux;
22+
for i in aarch64-macosx x86_64-macosx x86_64-linux;
2323
do
2424
raco cross --target $i make git-gerrit.rkt;
2525
raco cross --target $i exe --orig-exe -o git-gerrit.$i git-gerrit.rkt ;
2626
done
2727

28+
raco cross --target x86_64-win32 make git-gerrit.rkt
29+
raco cross --target x86_64-win32 exe --orig-exe --embed-dlls -o git-gerrit.x86_64-win32 git-gerrit.rkt

racket/git-gerrit.rkt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515

1616
#lang racket
1717

18-
(define VERSION "0.1-preview")
18+
(include/reader
19+
"version.inc"
20+
(lambda (fn p)
21+
(let ((s (read-line p)))
22+
(if (eof-object? s)
23+
s
24+
(datum->syntax #f `(define GIT-GERRIT-VERSION ,s))))))
25+
1926
(require "scsh/scsh-repf.rkt")
2027

2128
(require "alvs/and-let-values.rkt")
@@ -27,7 +34,7 @@
2734
[arch (system-type 'arch)]
2835
[vm (system-type 'vm)])
2936
(display (format
30-
"git-gerrit ~a.\n" VERSION))
37+
"git-gerrit ~a.\n" GIT-GERRIT-VERSION))
3138
(display (format "Runtime: racket(~a) ~a, ~a, ~a.\n"
3239
vm
3340
(version)

racket/version.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1-pre-1

0 commit comments

Comments
 (0)