31
31
name : package
32
32
path : target/package/margo-*.crate
33
33
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
+
34
66
release :
35
67
runs-on : ubuntu-latest
36
- needs : build-linux
68
+ needs : [ build-linux, build-windows, build-macos]
37
69
38
70
steps :
39
71
- name : Checkout code
@@ -44,20 +76,39 @@ jobs:
44
76
tag=$(echo ${{github.event.ref}} | cut -d/ -f3)
45
77
echo "tag=${tag}" >> $GITHUB_ENV
46
78
47
- - name : Download binary artifacts
79
+ - name : Download binary artifacts (Linux)
48
80
uses : actions/download-artifact@v4
49
81
with :
50
82
name : binary-linux
51
83
path : linux
52
84
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
+
53
97
- name : Fix artifact permissions
54
- run : chmod +x linux/margo
98
+ run : chmod +x { linux,macos-aarch64} /margo
55
99
56
100
- 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
58
105
59
106
- 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
61
112
env :
62
113
GH_TOKEN : ${{ github.token }}
63
114
0 commit comments