Skip to content

Commit 9bc2afc

Browse files
committed
Add windows build as artifact to releases
1 parent 0aab284 commit 9bc2afc

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/release-upload.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ name: Release Upload
2929
# so no release will get created. This is useful for debugging or
3030
# trying to build a release before tagging it.
3131
#
32-
# So far this pipeline supports releasing Linux and Darwin binaries.
32+
# So far this pipeline supports releasing Linux, Darwin, and Windows binaries.
3333
# Please see the "TODO generalize" comments in this file to support new platforms.
3434

3535
on:
@@ -135,7 +135,7 @@ jobs:
135135
strategy:
136136
matrix:
137137
# TODO generalize
138-
arch: [x86_64-linux, x86_64-darwin, aarch64-darwin, aarch64-linux]
138+
arch: [x86_64-linux, x86_64-darwin, aarch64-darwin, aarch64-linux, win64]
139139
name: "Download Asset"
140140
runs-on: ubuntu-latest
141141
steps:
@@ -164,6 +164,9 @@ jobs:
164164
"aarch64-linux")
165165
derivation+="x86_64-linux.ghc966-aarch64-unknown-linux-musl"
166166
;;
167+
"win64")
168+
derivation+="x86_64-linux.ghc966-x86_64-w64-mingw32"
169+
;;
167170
*)
168171
echo "Unexpected matrix.arch value: ${{ matrix.arch }}"
169172
exit 1
@@ -172,7 +175,14 @@ jobs:
172175
derivation+=".packages.cardano-cli:exe:cardano-cli"
173176
nix build --builders "" --max-jobs 0 ${{ env.LOCKED_URL }}#$derivation
174177
tree result
175-
cp result/bin/cardano-cli cardano-cli-${{ matrix.arch }} # (1)
178+
case ${{ matrix.arch }} in
179+
"win64")
180+
cp --dereference -r result/bin/ cardano-cli-win64
181+
;;
182+
*)
183+
cp result/bin/cardano-cli cardano-cli-${{ matrix.arch }} # (1)
184+
;;
185+
esac
176186
- uses: actions/upload-artifact@v4
177187
with:
178188
name: cardano-cli-${{ matrix.arch }}
@@ -198,13 +208,14 @@ jobs:
198208
tar -czf ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-$arch.tar.gz cardano-cli-$arch
199209
done
200210
# TODO generalize
201-
# zip ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-win64.zip cardano-cli-win64
211+
zip -r9 ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-win64.zip cardano-cli-win64
202212
- name: Checksums
203213
run: |
204214
# (3)
205215
for arch in x86_64-linux x86_64-darwin aarch64-darwin aarch64-linux; do
206216
sha256sum ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-$arch.tar.gz >> ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-sha256sums.txt
207217
done
218+
sha256sum ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-win64.zip >> ${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-sha256sums.txt
208219
- name: Create short tag
209220
run: |
210221
# Transform the long tag (e.g. "cardano-cli-8.22.0.0")
@@ -223,12 +234,12 @@ jobs:
223234
tag_name: ${{ needs.wait_for_hydra.outputs.TARGET_TAG }} # Git tag the release is attached to
224235
name: ${{ env.SHORT_TAG }} # Release name in GitHub UI
225236
# TODO generalize
226-
# cardano-cli-${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-win64.zip
227237
# All entries in 'files' below should match (2) and (3)
228238
files: |
229239
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-x86_64-linux.tar.gz
230240
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-x86_64-darwin.tar.gz
231241
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-aarch64-darwin.tar.gz
232242
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-aarch64-linux.tar.gz
243+
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-win64.zip
233244
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-sha256sums.txt
234245
body_path: RELEASE_CHANGELOG.md

0 commit comments

Comments
 (0)