Skip to content

Commit f899ccc

Browse files
authored
Update release-build.yml
1 parent 6c9cae8 commit f899ccc

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

.github/workflows/release-build.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
type: string
1010

1111
permissions:
12-
contents: write # needed to create releases
12+
contents: write
1313
packages: read
1414

1515
jobs:
@@ -22,10 +22,16 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
include:
25+
# Windows
2526
- os: windows-latest
2627
rid: win-x64
2728
fw: net9.0-desktop
2829
art: win-x64
30+
# macOS
31+
- os: macos-latest
32+
rid: osx-arm64
33+
fw: net9.0-macos
34+
art: macos-arm64
2935

3036
steps:
3137
# 1 ─ Checkout repositories
@@ -56,15 +62,14 @@ jobs:
5662
- name: Restore dependencies
5763
working-directory: ./AluaAchievements
5864
run: dotnet restore Alua.sln
59-
60-
# inside the “build” job ­steps
65+
66+
# 5 ─ Materialise the .env file from a secret
6167
- name: Write .env from secret
62-
working-directory: ./AluaAchievements/Alua # folder that holds Alua.csproj
63-
run: |
64-
# envcontent is expected to be the full text of the .env file
65-
printf '%s\n' "${{ secrets.envcontent }}" > .env
68+
working-directory: ./AluaAchievements/Alua
69+
shell: bash
70+
run: printf '%s\n' "${{ secrets.envcontent }}" > .env
6671

67-
# 5 ─ Publish self-contained, single-file binaries
72+
# 6 ─ Publish self-contained, single-file binaries
6873
- name: Publish application
6974
working-directory: ./AluaAchievements
7075
run: >
@@ -77,12 +82,18 @@ jobs:
7782
-o publish
7883
--no-restore
7984
80-
# 6 ─ Zip the publish output
85+
# 7 ─ Zip the publish output (cross-platform)
8186
- name: Archive artifact
8287
working-directory: ./AluaAchievements/publish
83-
run: 7z a ../../${{ matrix.art }}.zip *
88+
shell: bash
89+
run: |
90+
if command -v 7z >/dev/null 2>&1; then
91+
7z a ../../${{ matrix.art }}.zip *
92+
else
93+
zip -r ../../${{ matrix.art }}.zip .
94+
fi
8495
85-
# 7 ─ Upload artifact for the release job
96+
# 8 ─ Upload artifact for the release job
8697
- name: Upload artifact
8798
uses: actions/upload-artifact@v4
8899
with:

0 commit comments

Comments
 (0)