name: Release Launcher on: push: tags: - 'v*' workflow_dispatch: inputs: tag: description: 'Existing v* tag to (re-)release (re-runs the full build + publish)' required: true concurrency: group: release-launcher-${{ github.event.inputs.tag || github.ref_name }} cancel-in-progress: false permissions: contents: write jobs: test-and-lint: uses: ./.github/workflows/test-and-lint.yml build-macos: needs: test-and-lint runs-on: macos-latest timeout-minutes: 40 # Per-arch builds (not a universal binary): the bundled `claude` sidecar is a # Bun-compiled binary with an embedded Info.plist, and codesign corrupts the # non-native slice's Info.plist seal when re-signing a *fat* binary — which # fails notarization. Single-arch binaries re-sign cleanly, so we build each # arch separately, mirroring the Windows/Linux matrices. strategy: fail-fast: false matrix: include: - arch: arm64 rust-target: aarch64-apple-darwin artifact-name: macos-arm64-artifacts - arch: x64 rust-target: x86_64-apple-darwin artifact-name: macos-x64-artifacts defaults: run: working-directory: asyar-launcher steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.inputs.tag || github.ref_name }} - uses: actions/setup-node@v6 with: node-version: '22' - uses: pnpm/action-setup@v5 with: version: 10.26.0 - uses: dtolnay/rust-toolchain@1.97.0 with: targets: ${{ matrix.rust-target }} - uses: swatinem/rust-cache@v2 with: workspaces: asyar-launcher/src-tauri -> target key: ${{ matrix.rust-target }} - name: Install workspace dependencies run: pnpm install --frozen-lockfile working-directory: . - name: Sync SvelteKit run: pnpm svelte-kit sync - uses: oven-sh/setup-bun@v2 with: bun-version: latest - name: Build ext-builder sidecar JS working-directory: asyar-ext-builder run: | bun install bun run build:js - name: Import Apple certificate env: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} run: | KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain KEYCHAIN_PASSWORD=$(openssl rand -base64 32) security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" echo "$APPLE_CERTIFICATE" | base64 --decode > $RUNNER_TEMP/certificate.p12 security import $RUNNER_TEMP/certificate.p12 -k "$KEYCHAIN_PATH" -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" security list-keychains -d user -s "$KEYCHAIN_PATH" login.keychain-db - name: Build and Notarize env: APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} run: pnpm tauri build --target ${{ matrix.rust-target }} # Tauri names the updater bundle `.app.tar.gz` with no arch suffix, # so both arch builds would collide in the GitHub release. Add the arch so # the two updater bundles (and their .sig) stay distinct. - name: Tag updater bundle with arch run: | cd src-tauri/target/${{ matrix.rust-target }}/release/bundle/macos for f in *.app.tar.gz; do base="${f%.app.tar.gz}" mv "$f" "${base}_${{ matrix.arch }}.app.tar.gz" mv "$f.sig" "${base}_${{ matrix.arch }}.app.tar.gz.sig" done - name: Upload macOS ${{ matrix.arch }} Artifacts uses: actions/upload-artifact@v7 with: name: ${{ matrix.artifact-name }} path: | asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/bundle/dmg/*.dmg asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/bundle/macos/*.app.tar.gz* build-windows: needs: test-and-lint runs-on: ${{ matrix.runner }} timeout-minutes: 60 strategy: fail-fast: false matrix: include: - arch: x64 runner: windows-latest rust-target: x86_64-pc-windows-msvc artifact-name: windows-artifacts - arch: arm64 runner: windows-11-arm rust-target: aarch64-pc-windows-msvc artifact-name: windows-arm64-artifacts defaults: run: working-directory: asyar-launcher steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.inputs.tag || github.ref_name }} - uses: actions/setup-node@v6 with: node-version: '22' - uses: pnpm/action-setup@v5 with: version: 10.26.0 - uses: dtolnay/rust-toolchain@1.97.0 with: targets: ${{ matrix.rust-target }} - uses: swatinem/rust-cache@v2 with: workspaces: asyar-launcher/src-tauri -> target key: ${{ matrix.rust-target }} - name: Install workspace dependencies run: pnpm install --frozen-lockfile working-directory: . - name: Sync SvelteKit run: pnpm svelte-kit sync - uses: oven-sh/setup-bun@v2 with: bun-version: latest - name: Build ext-builder sidecar JS working-directory: asyar-ext-builder run: | bun install bun run build:js - name: Build Windows ${{ matrix.arch }} env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} run: pnpm tauri build --target ${{ matrix.rust-target }} - name: Package Portable Windows ${{ matrix.arch }} Zip shell: pwsh run: | $target = "${{ matrix.rust-target }}" $arch = "${{ matrix.arch }}" $releaseDir = "src-tauri/target/$target/release" $portableDir = "$releaseDir/portable/asyar" if (Test-Path "$releaseDir/portable") { Remove-Item -Recurse -Force "$releaseDir/portable" } New-Item -ItemType Directory -Force -Path $portableDir | Out-Null Copy-Item "$releaseDir/asyar.exe" -Destination "$portableDir/" if (Test-Path "src-tauri/built-in-features") { Copy-Item -Recurse "src-tauri/built-in-features" -Destination "$portableDir/" } if (Test-Path "src-tauri/resources") { Copy-Item -Recurse "src-tauri/resources" -Destination "$portableDir/" } $zipPath = "$releaseDir/asyar_windows_${arch}_portable.zip" Compress-Archive -Path "$portableDir/*" -DestinationPath $zipPath -Force Write-Host "Created portable archive at $zipPath" - name: Upload Windows ${{ matrix.arch }} Artifacts uses: actions/upload-artifact@v7 with: name: ${{ matrix.artifact-name }} path: | asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/bundle/msi/*.msi asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/bundle/msi/*.msi.sig asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/*.zip build-linux: needs: test-and-lint runs-on: ${{ matrix.runner }} timeout-minutes: 60 strategy: fail-fast: false matrix: include: - arch: amd64 runner: ubuntu-22.04 rust-target: x86_64-unknown-linux-gnu summon-source: asyar-summon-x86_64-unknown-linux-gnu summon-asset: asyar-summon_amd64 artifact-name: linux-amd64-artifacts - arch: arm64 runner: ubuntu-24.04-arm rust-target: aarch64-unknown-linux-gnu summon-source: asyar-summon-aarch64-unknown-linux-gnu summon-asset: asyar-summon_aarch64 artifact-name: linux-arm64-artifacts defaults: run: working-directory: asyar-launcher steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.inputs.tag || github.ref_name }} - name: Install Linux system dependencies working-directory: . run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libxdo-dev xdg-utils zsync # libfuse2 on Ubuntu 22.04, libfuse2t64 on Ubuntu 24.04 sudo apt-get install -y libfuse2 || sudo apt-get install -y libfuse2t64 - uses: actions/setup-node@v6 with: node-version: '22' - uses: pnpm/action-setup@v5 with: version: 10.26.0 - uses: dtolnay/rust-toolchain@1.97.0 with: targets: ${{ matrix.rust-target }} - uses: swatinem/rust-cache@v2 with: workspaces: asyar-launcher/src-tauri -> target key: linux-${{ matrix.arch }} - name: Install workspace dependencies run: pnpm install --frozen-lockfile working-directory: . - name: Sync SvelteKit run: pnpm svelte-kit sync - uses: oven-sh/setup-bun@v2 with: bun-version: latest - name: Build ext-builder sidecar JS working-directory: asyar-ext-builder run: | bun install bun run build:js # linuxdeploy walks every ELF in AppDir/usr/bin/ and aborts when ldd # exits non-zero. The bundled `bun` sidecar trips this — bun is # dynamically linked but its runtime mis-behaves under # LD_TRACE_LOADED_OBJECTS=1, so ldd exits 1 instead of printing deps. # The shim swallows ldd failures so bundling can finish; bun's only # deps are glibc libs linuxdeploy blacklists anyway. - name: Install ldd shim (linuxdeploy + bun workaround) run: | sudo install -m 0755 scripts/ci/ldd-shim.sh /usr/local/bin/ldd which ldd head -3 "$(which ldd)" # Tauri's mirrored linuxdeploy predates support for the # LINUXDEPLOY_EXCLUDED_LIBRARIES environment variable. A current # upstream binary must be present in Tauri's tool cache before the # bundle starts so the signed AppImage never contains the build # runner's libwayland-client. - name: Install linuxdeploy with library exclusion support run: | set -euo pipefail case "$(uname -m)" in x86_64) linuxdeploy_arch="x86_64" ;; aarch64|arm64) linuxdeploy_arch="aarch64" ;; *) echo "Unsupported linuxdeploy architecture: $(uname -m)" >&2; exit 1 ;; esac tauri_tools_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/tauri" linuxdeploy_cache_path="${tauri_tools_dir}/linuxdeploy-${linuxdeploy_arch}.AppImage" mkdir -p "$tauri_tools_dir" curl -L --fail --show-error --retry 3 \ -o "$linuxdeploy_cache_path" \ "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${linuxdeploy_arch}.AppImage" chmod 0755 "$linuxdeploy_cache_path" "$linuxdeploy_cache_path" --appimage-extract-and-run --version - name: Build Linux ${{ matrix.arch }} env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} # Tauri's bundler invokes linuxdeploy/appimagetool — themselves AppImages. # Ubuntu 24.04 blocks their default FUSE/userns mount path, so tell them # to self-extract to a temp dir instead. Official CI-mode flag, not a hack. APPIMAGE_EXTRACT_AND_RUN: '1' # libwayland-client is part of the host graphics ABI. Bundling the # Ubuntu runner's copy alongside a newer host Mesa makes WebKitGTK's # eglGetDisplay(EGL_DEFAULT_DISPLAY) fail with EGL_BAD_PARAMETER. LINUXDEPLOY_EXCLUDED_LIBRARIES: 'libwayland-client.so*' # Embed AppImage update metadata for AppImageUpdate / zsync delta updates (issue #668) UPDATE_INFORMATION: 'gh-releases-zsync|Xoshbin|asyar|latest|*${{ matrix.arch }}*.AppImage.zsync' LDAI_UPDATE_INFORMATION: 'gh-releases-zsync|Xoshbin|asyar|latest|*${{ matrix.arch }}*.AppImage.zsync' run: | pnpm tauri build -v --target ${{ matrix.rust-target }} SUMMON_SOURCE="src-tauri/binaries/${{ matrix.summon-source }}" SUMMON_ASSET="src-tauri/target/${{ matrix.rust-target }}/release/${{ matrix.summon-asset }}" test -x "$SUMMON_SOURCE" install -m 0755 "$SUMMON_SOURCE" "$SUMMON_ASSET" cd src-tauri/target/${{ matrix.rust-target }}/release/bundle/appimage for f in *.AppImage; do if [ -f "$f" ] && [ ! -f "$f.zsync" ]; then zsyncmake -u "$f" "$f" fi done - name: Verify AppImage graphics ABI run: | set -euo pipefail appimage_dir="src-tauri/target/${{ matrix.rust-target }}/release/bundle/appimage" appimage_path="$(find "$appimage_dir" -maxdepth 1 -type f -name '*.AppImage' -print -quit)" if [ -z "$appimage_path" ]; then echo "No AppImage found in ${appimage_dir}" >&2 exit 1 fi appimage_path="$(readlink -f "$appimage_path")" verification_dir="$(mktemp -d)" diricon_dir="$(mktemp -d)" cleanup() { rm -rf "$verification_dir" "$diricon_dir" } trap cleanup EXIT INT TERM ( cd "$verification_dir" "$appimage_path" --appimage-extract 'usr/lib/libwayland-client.so*' >/dev/null if find squashfs-root \( -type f -o -type l \) -name 'libwayland-client.so*' -print -quit | grep -q .; then echo "AppImage incorrectly bundles libwayland-client:" >&2 find squashfs-root \( -type f -o -type l \) -name 'libwayland-client.so*' -print >&2 exit 1 fi ) # Verify AppImage spec compliance: .DirIcon must exist and resolve. # Done against a FULL extraction, in its own directory, because # --appimage-extract only writes paths matching its pattern: .DirIcon # is a symlink whose target is itself usually a symlink into # usr/share/icons, so no fixed number of pattern extractions is # guaranteed to materialise the whole chain. Extract once and let -e # walk it however deep it goes. ( cd "$diricon_dir" "$appimage_path" --appimage-extract >/dev/null if [ ! -e squashfs-root/.DirIcon ]; then echo "AppImage is missing or has a broken .DirIcon:" >&2 ls -la squashfs-root/.DirIcon 2>&1 || true echo "resolves to: $(readlink -f squashfs-root/.DirIcon 2>&1 || echo '')" >&2 exit 1 fi ) - name: Verify Debian package dependencies run: | set -euo pipefail deb_dir="src-tauri/target/${{ matrix.rust-target }}/release/bundle/deb" deb_path="$(find "$deb_dir" -maxdepth 1 -type f -name '*.deb' -print -quit)" if [ -z "$deb_path" ]; then echo "No .deb package found in ${deb_dir}" >&2 exit 1 fi echo "Inspecting control metadata for: ${deb_path}" control_info="$(dpkg-deb -I "$deb_path")" echo "$control_info" | grep -E '^ Depends:' || { echo "Error: Generated .deb package is missing Depends line:" >&2 echo "$control_info" >&2 exit 1 } if ! echo "$control_info" | grep -E '^ Depends:' | grep -q "libxdo3"; then echo "Error: Generated .deb package Depends does not contain libxdo3:" >&2 echo "$control_info" | grep -E '^ Depends:' >&2 exit 1 fi echo "Debian package dependencies verified successfully." - name: Upload Linux ${{ matrix.arch }} Artifacts uses: actions/upload-artifact@v7 with: name: ${{ matrix.artifact-name }} if-no-files-found: error path: | asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/bundle/appimage/*.AppImage asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/bundle/appimage/*.AppImage.sig asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/bundle/appimage/*.zsync asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/bundle/deb/*.deb asyar-launcher/src-tauri/target/${{ matrix.rust-target }}/release/${{ matrix.summon-asset }} publish: needs: [build-macos, build-windows, build-linux] runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.inputs.tag || github.ref_name }} fetch-depth: 0 - name: Download all artifacts uses: actions/download-artifact@v8 with: path: artifacts - name: Clean up stale draft releases env: GH_TOKEN: ${{ github.token }} TAG: ${{ github.ref_name }} run: | gh release list --json tagName,isDraft --jq ".[] | select(.tagName==\"$TAG\" and .isDraft) | .tagName" | while read -r t; do echo "Deleting stale draft release for $t..." gh release delete "$t" --yes --cleanup-tag=false done - name: Determine previous launcher release tag id: prev_tag run: | CURRENT_TAG="${{ github.event.inputs.tag || github.ref_name }}" PREV_TAG=$(git tag -l 'v*' --sort=-creatordate | grep -Fvx "$CURRENT_TAG" | head -n 1) echo "tag=$PREV_TAG" >> "$GITHUB_OUTPUT" - name: Create GitHub Release uses: softprops/action-gh-release@v2.6.1 with: tag_name: ${{ github.event.inputs.tag || github.ref_name }} files: | artifacts/**/*.dmg artifacts/**/*.app.tar.gz* artifacts/**/*.msi artifacts/**/*.msi.sig artifacts/**/*.AppImage artifacts/**/*.AppImage.sig artifacts/**/*.zsync artifacts/**/*.deb artifacts/**/*.zip artifacts/**/asyar-summon_* draft: false prerelease: ${{ contains(github.event.inputs.tag || github.ref_name, '-') }} generate_release_notes: true # See release-sdk.yml: without an explicit base, GitHub's auto-notes # picks the most recently published release repo-wide, which can be # an `sdk-v*` tag rather than the last launcher release — pin it. previous_tag: ${{ steps.prev_tag.outputs.tag }} - name: Notify Website env: ASYAR_UPDATE_TOKEN: ${{ secrets.ASYAR_UPDATE_TOKEN }} APP_URL: 'https://asyar.org' REF_NAME: ${{ github.event.inputs.tag || github.ref_name }} REPO: ${{ github.repository }} run: | VERSION="${REF_NAME#v}" # Detect type: any hyphenated version (e.g., 0.1.0-1) is treated as beta TYPE="stable" if [[ "$VERSION" == *-* ]]; then TYPE="beta" fi # Locate files using find to handle any directory structure. # Scope multi-arch artifacts (Windows, Linux) to their per-arch # artifact dirs so different-arch builds don't get cross-picked. MAC_AARCH64_FILE_PATH=$(find artifacts/macos-arm64-artifacts -name "*.app.tar.gz" | head -n 1) MAC_X64_FILE_PATH=$(find artifacts/macos-x64-artifacts -name "*.app.tar.gz" | head -n 1) # The .app.tar.gz above is the updater bundle (fed to the Tauri # updater via `url`). Users clicking "Download" want the installable # .dmg instead, exposed separately as `download_url`. MAC_AARCH64_DMG_PATH=$(find artifacts/macos-arm64-artifacts -name "*.dmg" | head -n 1) MAC_X64_DMG_PATH=$(find artifacts/macos-x64-artifacts -name "*.dmg" | head -n 1) WIN_X64_FILE_PATH=$(find artifacts/windows-artifacts -name "*.msi" | head -n 1) WIN_ARM64_FILE_PATH=$(find artifacts/windows-arm64-artifacts -name "*.msi" | head -n 1) LINUX_FILE_PATH=$(find artifacts/linux-amd64-artifacts -name "*.AppImage" | head -n 1) LINUX_ARM64_FILE_PATH=$(find artifacts/linux-arm64-artifacts -name "*.AppImage" | head -n 1) MAC_AARCH64_SIG_PATH=$(find artifacts/macos-arm64-artifacts -name "*.app.tar.gz.sig" | head -n 1) MAC_X64_SIG_PATH=$(find artifacts/macos-x64-artifacts -name "*.app.tar.gz.sig" | head -n 1) WIN_X64_SIG_PATH=$(find artifacts/windows-artifacts -name "*.msi.sig" | head -n 1) WIN_ARM64_SIG_PATH=$(find artifacts/windows-arm64-artifacts -name "*.msi.sig" | head -n 1) LINUX_SIG_PATH=$(find artifacts/linux-amd64-artifacts -name "*.AppImage.sig" | head -n 1) LINUX_ARM64_SIG_PATH=$(find artifacts/linux-arm64-artifacts -name "*.AppImage.sig" | head -n 1) if [[ -z "$MAC_AARCH64_FILE_PATH" || -z "$MAC_X64_FILE_PATH" || -z "$MAC_AARCH64_DMG_PATH" || -z "$MAC_X64_DMG_PATH" || -z "$WIN_X64_FILE_PATH" || -z "$WIN_ARM64_FILE_PATH" || -z "$LINUX_FILE_PATH" || -z "$LINUX_ARM64_FILE_PATH" ]]; then echo "Error: Binaries missing in artifacts. Note: macOS requires per-arch .app.tar.gz + .dmg (arm64 + x64)" ls -R artifacts exit 1 fi if [[ -z "$MAC_AARCH64_SIG_PATH" || -z "$MAC_X64_SIG_PATH" || -z "$WIN_X64_SIG_PATH" || -z "$WIN_ARM64_SIG_PATH" || -z "$LINUX_SIG_PATH" || -z "$LINUX_ARM64_SIG_PATH" ]]; then echo "Error: Signatures (.sig files) missing in artifacts. Check tauri.conf.json bundle configuration." ls -R artifacts exit 1 fi MAC_AARCH64_SIG=$(cat "$MAC_AARCH64_SIG_PATH") MAC_X64_SIG=$(cat "$MAC_X64_SIG_PATH") WIN_X64_SIG=$(cat "$WIN_X64_SIG_PATH") WIN_ARM64_SIG=$(cat "$WIN_ARM64_SIG_PATH") LINUX_SIG=$(cat "$LINUX_SIG_PATH") LINUX_ARM64_SIG=$(cat "$LINUX_ARM64_SIG_PATH") MAC_AARCH64_FILE=$(basename "$MAC_AARCH64_FILE_PATH") MAC_X64_FILE=$(basename "$MAC_X64_FILE_PATH") MAC_AARCH64_DMG=$(basename "$MAC_AARCH64_DMG_PATH") MAC_X64_DMG=$(basename "$MAC_X64_DMG_PATH") WIN_X64_FILE=$(basename "$WIN_X64_FILE_PATH") WIN_ARM64_FILE=$(basename "$WIN_ARM64_FILE_PATH") LINUX_FILE=$(basename "$LINUX_FILE_PATH") LINUX_ARM64_FILE=$(basename "$LINUX_ARM64_FILE_PATH") TAG="$REF_NAME" BASE_URL="https://github.com/$REPO/releases/download/$TAG" PAYLOAD=$(printf '{"version":"%s","type":"%s","notes":"Automated multi-platform release %s","platforms":{"darwin-aarch64":{"url":"%s/%s","download_url":"%s/%s","signature":"%s"},"darwin-x86_64":{"url":"%s/%s","download_url":"%s/%s","signature":"%s"},"windows-x86_64":{"url":"%s/%s","signature":"%s"},"windows-aarch64":{"url":"%s/%s","signature":"%s"},"linux-x86_64":{"url":"%s/%s","signature":"%s"},"linux-aarch64":{"url":"%s/%s","signature":"%s"}}}' \ "$VERSION" "$TYPE" "$VERSION" \ "$BASE_URL" "$MAC_AARCH64_FILE" "$BASE_URL" "$MAC_AARCH64_DMG" "$MAC_AARCH64_SIG" \ "$BASE_URL" "$MAC_X64_FILE" "$BASE_URL" "$MAC_X64_DMG" "$MAC_X64_SIG" \ "$BASE_URL" "$WIN_X64_FILE" "$WIN_X64_SIG" \ "$BASE_URL" "$WIN_ARM64_FILE" "$WIN_ARM64_SIG" \ "$BASE_URL" "$LINUX_FILE" "$LINUX_SIG" \ "$BASE_URL" "$LINUX_ARM64_FILE" "$LINUX_ARM64_SIG") # --fail-with-body: non-2xx → non-zero exit (no more silent failures). # Retries cover transient asyar.org/network blips; the endpoint upserts # by version (Release::updateOrCreate), so retries are safe. curl --fail-with-body --retry 3 --retry-all-errors --retry-delay 5 \ -X POST "$APP_URL/api/releases" \ -H "Content-Type: application/json" \ -H "X-Asyar-Update-Token: $ASYAR_UPDATE_TOKEN" \ -d "$PAYLOAD" - name: Update Homebrew Cask env: HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} REF_NAME: ${{ github.event.inputs.tag || github.ref_name }} run: | # Requires the one-time tap setup in RELEASING.md. Skip quietly until # HOMEBREW_TAP_TOKEN exists so this step can't block a release. if [[ -z "$HOMEBREW_TAP_TOKEN" ]]; then echo "HOMEBREW_TAP_TOKEN not set — skipping Homebrew cask update." exit 0 fi VERSION="${REF_NAME#v}" MAC_AARCH64_DMG_PATH=$(find artifacts/macos-arm64-artifacts -name "*.dmg" | head -n 1) MAC_X64_DMG_PATH=$(find artifacts/macos-x64-artifacts -name "*.dmg" | head -n 1) SHA_ARM64=$(sha256sum "$MAC_AARCH64_DMG_PATH" | cut -d' ' -f1) SHA_X64=$(sha256sum "$MAC_X64_DMG_PATH" | cut -d' ' -f1) git clone --depth 1 "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/Xoshbin/homebrew-asyar.git" tap mkdir -p tap/Casks cat > tap/Casks/asyar.rb <> "$GITHUB_OUTPUT" # Runs as its own step (not a run: block like the Homebrew one above) # because submitting to winget-pkgs needs Komac's MSI/manifest handling, # not something worth reimplementing in bash. Deliberately kept in this # same job rather than a separate `on: release` workflow: action-gh-release # above publishes using the default GITHUB_TOKEN, and GitHub does not # cascade a second workflow run off events created by that token. - name: Update winget manifest if: steps.winget_check.outputs.eligible == 'true' uses: vedantmgoyal9/winget-releaser@v2 with: identifier: Xoshbin.Asyar token: ${{ secrets.WINGET_TOKEN }} release-tag: ${{ github.event.inputs.tag || github.ref_name }}