-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (87 loc) · 2.96 KB
/
release.yml
File metadata and controls
104 lines (87 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-executables:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
arch: x64
ext: ""
- os: macos-latest
platform: macos
arch: arm64
ext: ""
- os: windows-latest
platform: windows
arch: x64
ext: ".exe"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Racket
uses: Bogdanp/setup-racket@v1.11
with:
architecture: ${{ matrix.arch }}
distribution: full
version: stable
- name: Compile
run: |
raco make randstr/main.rkt
raco make randstr/cli/main.rkt
- name: Build executable (Unix)
if: matrix.platform != 'windows'
run: |
mkdir -p build
raco exe -o build/randstr randstr/cli/main.rkt
- name: Build executable (Windows)
if: matrix.platform == 'windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path build
raco exe -o build/randstr.exe randstr/cli/main.rkt
- name: Create distribution (Unix)
if: matrix.platform != 'windows'
run: raco distribute dist build/randstr
- name: Create distribution (Windows)
if: matrix.platform == 'windows'
run: raco distribute dist build/randstr.exe
- name: Archive distribution (Unix tar.gz)
if: matrix.platform != 'windows'
run: |
cd dist
tar -czvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz .
- name: Archive distribution (Unix tar.xz)
if: matrix.platform != 'windows'
run: |
cd dist
tar -cJvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.xz .
- name: Archive distribution (Unix tar.zst)
if: matrix.platform != 'windows'
run: |
cd dist
tar --zstd -cvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.zst .
- name: Archive distribution (Windows)
if: matrix.platform == 'windows'
shell: pwsh
run: |
Compress-Archive -Path dist/* -DestinationPath randstr-${{ matrix.platform }}-${{ matrix.arch }}.zip -CompressionLevel Optimal
- name: Upload release assets (Unix)
if: matrix.platform != 'windows'
uses: softprops/action-gh-release@v2
with:
files: |
randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.xz
randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.zst
- name: Upload release asset (Windows)
if: matrix.platform == 'windows'
uses: softprops/action-gh-release@v2
with:
files: randstr-${{ matrix.platform }}-${{ matrix.arch }}.zip