Skip to content

Commit 8714829

Browse files
authored
Merge pull request #23 from integer32llc/more-platforms
Build Windows and macOS binaries in GitHub Actions
2 parents 8897c9e + 998822b commit 8714829

File tree

1 file changed

+56
-5
lines changed

1 file changed

+56
-5
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,41 @@ jobs:
3131
name: package
3232
path: target/package/margo-*.crate
3333

34+
build-windows:
35+
runs-on: windows-latest
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Build code
42+
run: cargo build --release
43+
44+
- name: Save binary artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: binary-windows
48+
path: target/release/margo.exe
49+
50+
build-macos:
51+
runs-on: macos-latest
52+
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v4
56+
57+
- name: Build code
58+
run: cargo build --release
59+
60+
- name: Save binary artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: binary-macos-aarch64
64+
path: target/release/margo
65+
3466
release:
3567
runs-on: ubuntu-latest
36-
needs: build-linux
68+
needs: [build-linux, build-windows, build-macos]
3769

3870
steps:
3971
- name: Checkout code
@@ -44,20 +76,39 @@ jobs:
4476
tag=$(echo ${{github.event.ref}} | cut -d/ -f3)
4577
echo "tag=${tag}" >> $GITHUB_ENV
4678
47-
- name: Download binary artifacts
79+
- name: Download binary artifacts (Linux)
4880
uses: actions/download-artifact@v4
4981
with:
5082
name: binary-linux
5183
path: linux
5284

85+
- name: Download binary artifacts (Windows)
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: binary-windows
89+
path: windows
90+
91+
- name: Download binary artifacts (macOS)
92+
uses: actions/download-artifact@v4
93+
with:
94+
name: binary-macos-aarch64
95+
path: macos-aarch64
96+
5397
- name: Fix artifact permissions
54-
run: chmod +x linux/margo
98+
run: chmod +x {linux,macos-aarch64}/margo
5599

56100
- name: Compress artifacts
57-
run: tar czf margo-linux-x86_64.tar.gz -C linux margo
101+
run: |
102+
tar czf margo-linux-x86_64.tar.gz -C linux margo
103+
tar czf margo-macos-aarch64.tar.gz -C macos-aarch64 margo
104+
pushd windows; zip ../margo-windows-x86_64.exe.zip margo.exe; popd
58105
59106
- name: Release
60-
run: gh release create ${tag} margo-linux-x86_64.tar.gz
107+
run: |
108+
gh release create ${tag} \
109+
margo-linux-x86_64.tar.gz \
110+
margo-macos-aarch64.tar.gz \
111+
margo-windows-x86_64.exe.zip
61112
env:
62113
GH_TOKEN: ${{ github.token }}
63114

0 commit comments

Comments
 (0)