@@ -52,29 +52,22 @@ jobs:
5252 with :
5353 # If manually triggered, use the input branch; otherwise use the tag ref
5454 ref : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target_branch || github.ref_name }}
55+ fetch-depth : 0
5556
56- - name : Setup .NET (8.x)
57- uses : actions/setup-dotnet@v3
58- with :
59- dotnet-version : ' 8.0.x'
60-
61- - name : Read Version
62- id : get_version
57+ - name : Ensure full git history
6358 shell : bash
6459 run : |
6560 set -euo pipefail
66-
67- if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
68- VERSION="0.0.1"
69- elif [[ "${{ github.ref_type }}" == "tag" ]]; then
70- VERSION="${GITHUB_REF#refs/tags/}"
71- VERSION="${VERSION#release-v}"
61+ if git rev-parse --is-shallow-repository | grep -q true; then
62+ git fetch --prune --unshallow --tags
7263 else
73- VERSION="0.0.0-dev"
64+ git fetch --prune --tags
7465 fi
75-
76- echo "VERSION=$VERSION" >> "$GITHUB_ENV"
77- echo "v$VERSION" > Companion.Desktop/VERSION
66+
67+ - name : Setup .NET (8.x)
68+ uses : actions/setup-dotnet@v3
69+ with :
70+ dotnet-version : ' 8.0.x'
7871
7972 - name : Restore dependencies
8073 run : dotnet restore Companion.Desktop/Companion.Desktop.csproj
@@ -108,19 +101,6 @@ jobs:
108101 -p:PublishSingleFile=true
109102 fi
110103
111- - name : Write VERSION into publish output
112- shell : bash
113- run : |
114- set -euo pipefail
115- case "${{ runner.os }}" in
116- Windows) PUBLISH_DIR="Companion.Desktop/bin/Release/net8.0/win-${{ matrix.arch }}/publish" ;;
117- macOS) PUBLISH_DIR="Companion.Desktop/bin/Release/net8.0/osx-${{ matrix.arch }}/publish" ;;
118- Linux) PUBLISH_DIR="Companion.Desktop/bin/Release/net8.0/linux-${{ matrix.arch }}/publish" ;;
119- esac
120- echo "v${{ env.VERSION }}" > "$PUBLISH_DIR/VERSION"
121- echo "Wrote VERSION to $PUBLISH_DIR/VERSION:"
122- cat "$PUBLISH_DIR/VERSION"
123-
124104 # ----- macOS: bundle .app + sign + dmg -----
125105 - name : Decode signing certificate
126106 if : matrix.os == 'macos-latest'
@@ -267,6 +247,9 @@ jobs:
267247 hdiutil create -volname "Companion" -srcfolder dmg_build -ov -format UDZO -fs HFS+ -size 500m "${DMG_NAME}"
268248 rm -rf dmg_build
269249
250+ rm -f "Companion-macos-${{ matrix.arch }}.zip"
251+ zip -r "Companion-macos-${{ matrix.arch }}.zip" "${APP_DIR}"
252+
270253 # ----- Linux packaging -----
271254 - name : Linux - zip publish folder
272255 if : matrix.os == 'ubuntu-latest'
@@ -301,6 +284,13 @@ jobs:
301284 name : Companion-macos-${{ matrix.arch }}
302285 path : Companion-macos-${{ matrix.arch }}.dmg
303286 compression-level : 9
287+ - name : Upload macOS App Zip
288+ if : matrix.os == 'macos-latest'
289+ uses : actions/upload-artifact@v4
290+ with :
291+ name : Companion-macos-${{ matrix.arch }}-app
292+ path : Companion-macos-${{ matrix.arch }}.zip
293+ compression-level : 9
304294
305295 - name : Upload Windows Artifact
306296 if : matrix.os == 'windows-latest'
@@ -314,7 +304,7 @@ jobs:
314304 uses : actions/upload-artifact@v4
315305 with :
316306 name : Companion-linux-${{ matrix.arch }}
317- path : Companion- linux-${{ matrix.arch }}.zip
307+ path : ./ Companion.Desktop/bin/Release/net8.0/ linux-${{ matrix.arch }}/publish/**
318308 compression-level : 0
319309
320310 release :
@@ -353,11 +343,17 @@ jobs:
353343 fi
354344 done
355345
356- # Copy Linux zips (they are inside artifact folders)
357- find ./artifacts -type f -name "Companion-linux-*.zip" -exec cp {} ./release_files/ \;
346+ # Re-zip Linux folders to a single file per arch
347+ for arch in x64 arm64; do
348+ if [ -d "./artifacts/Companion-linux-${arch}" ]; then
349+ (cd "./artifacts/Companion-linux-${arch}" && zip -r "../../release_files/Companion-linux-${arch}.zip" .)
350+ fi
351+ done
358352
359353 # Copy macOS DMGs (also inside artifact folders)
360354 find ./artifacts -type f -name "Companion-macos-*.dmg" -exec cp {} ./release_files/ \;
355+ # Copy macOS app zips
356+ find ./artifacts -type f -name "Companion-macos-*.zip" -exec cp {} ./release_files/ \;
361357
362358 ls -la ./release_files
363359
@@ -385,10 +381,11 @@ jobs:
385381 ### Downloads
386382 * **Windows**: `Companion-windows-x64.zip` / `Companion-windows-arm64.zip`
387383 * **macOS**: `Companion-macos-x64.dmg` / `Companion-macos-arm64.dmg`
384+ * **macOS (App ZIP)**: `Companion-macos-x64.zip` / `Companion-macos-arm64.zip`
388385 * **Linux**: `Companion-linux-x64.zip` / `Companion-linux-arm64.zip`
389386
390387 ### Install
391388 * **Windows**: unzip and run `Companion.Desktop.exe`.
392- * **macOS**: open `.dmg` and drag **Companion.app** to Applications.
389+ * **macOS**: open `.dmg` and drag **Companion.app** to Applications. (ZIP contains the `.app` bundle.)
393390 * **Linux**: unzip and run `./Companion.Desktop` (chmod +x if needed).
394391 files : ./release_files/*
0 commit comments