diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 7ded49f..0236b2b 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -62,7 +62,23 @@ jobs: - name: Build cross-platform app working-directory: cross-platform - run: npm run build -- --verbose + shell: bash + run: | + case "${{ matrix.os }}" in + windows-2022) + npx tauri build --bundles nsis,msi --verbose + ;; + ubuntu-22.04) + npx tauri build --bundles appimage --verbose + ;; + macos-14) + npx tauri build --bundles app --verbose + ;; + *) + echo "Unsupported runner: ${{ matrix.os }}" + exit 1 + ;; + esac - name: Package macOS app bundle if: matrix.os == 'macos-14' @@ -79,19 +95,27 @@ jobs: shell: bash run: | shopt -s nullglob globstar - installer_candidates=( - cross-platform/src-tauri/target/release/bundle/nsis/**/*.exe - cross-platform/src-tauri/target/release/bundle/msi/**/*.msi + release_dir="cross-platform/src-tauri/target/release" + bundle_dir="$release_dir/bundle" + msi_candidates=( + "$bundle_dir"/**/*.msi + ) + portable_candidates=( + "$release_dir"/*.exe ) - if [ ${#installer_candidates[@]} -eq 0 ]; then - echo "No Windows installer artifacts found under cross-platform/src-tauri/target/release/bundle/{nsis,msi,wix}" - exit 1 - fi artifact_dir="PinStick-${APP_VERSION}-windows" mkdir -p "$artifact_dir" - for installer_path in "${installer_candidates[@]}"; do - cp "$installer_path" "$artifact_dir/" - done + if [ ${#msi_candidates[@]} -eq 0 ] || [ ${#portable_candidates[@]} -eq 0 ]; then + echo "Expected MSI installer under $bundle_dir and portable EXE under $release_dir" + if [ -d "$release_dir" ]; then + find "$release_dir" -maxdepth 4 -type f | sort + else + echo "Release directory missing: $release_dir" + fi + exit 1 + fi + cp "${msi_candidates[0]}" "$artifact_dir/PinStick-install.msi" + cp "${portable_candidates[0]}" "$artifact_dir/PinStick-portable.exe" printf "WINDOWS_ARTIFACT_DIR=%s\n" "$artifact_dir" >> "$GITHUB_ENV" - name: Collect Linux AppImage diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 1d2fa92..80f6b97 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -69,7 +69,23 @@ jobs: - name: Build cross-platform app working-directory: cross-platform - run: npm run build -- --verbose + shell: bash + run: | + case "${{ runner.os }}" in + Windows) + npm run tauri -- build --bundles nsis,msi --verbose + ;; + Linux) + npm run tauri -- build --bundles appimage --verbose + ;; + macOS) + npm run tauri -- build --bundles app --verbose + ;; + *) + echo "Unsupported runner OS: ${{ runner.os }}" + exit 1 + ;; + esac - name: Package macOS app bundle if: matrix.os == 'macos-14' @@ -86,19 +102,27 @@ jobs: shell: bash run: | shopt -s nullglob globstar - installer_candidates=( - cross-platform/src-tauri/target/release/bundle/nsis/**/*.exe - cross-platform/src-tauri/target/release/bundle/msi/**/*.msi + release_dir="cross-platform/src-tauri/target/release" + bundle_dir="$release_dir/bundle" + msi_candidates=( + "$bundle_dir"/**/*.msi + ) + portable_candidates=( + "$release_dir"/*.exe ) - if [ ${#installer_candidates[@]} -eq 0 ]; then - echo "No Windows installer artifacts found under cross-platform/src-tauri/target/release/bundle/{nsis,msi,wix}" - exit 1 - fi artifact_dir="PinStick-${APP_VERSION}-windows" mkdir -p "$artifact_dir" - for installer_path in "${installer_candidates[@]}"; do - cp "$installer_path" "$artifact_dir/" - done + if [ ${#msi_candidates[@]} -eq 0 ] || [ ${#portable_candidates[@]} -eq 0 ]; then + echo "Expected MSI installer under $bundle_dir and portable EXE under $release_dir" + if [ -d "$release_dir" ]; then + find "$release_dir" -maxdepth 4 -type f | sort + else + echo "Release directory missing: $release_dir" + fi + exit 1 + fi + cp "${msi_candidates[0]}" "$artifact_dir/PinStick-install.msi" + cp "${portable_candidates[0]}" "$artifact_dir/PinStick-portable.exe" printf "WINDOWS_ARTIFACT_DIR=%s\n" "$artifact_dir" >> "$GITHUB_ENV" - name: Collect Linux AppImage diff --git a/cross-platform/src-tauri/tauri.conf.json b/cross-platform/src-tauri/tauri.conf.json index 2c482b8..4b5d10d 100644 --- a/cross-platform/src-tauri/tauri.conf.json +++ b/cross-platform/src-tauri/tauri.conf.json @@ -2,6 +2,7 @@ "build": { "beforeBuildCommand": "", "beforeDevCommand": "", + "withGlobalTauri": true, "devPath": "../src", "distDir": "../src" }, @@ -14,7 +15,8 @@ "active": true, "identifier": "slf.pinstick", "icon": [ - "icons/icon.png" + "icons/icon.png", + "icons/icon.ico" ] }, "windows": [