test release #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Build | |
| on: | |
| push: | |
| branches: | |
| - release | |
| jobs: | |
| release: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: 'macos-latest' | |
| args: '--target aarch64-apple-darwin' | |
| - platform: 'macos-latest' | |
| args: '--target x86_64-apple-darwin' | |
| - platform: 'ubuntu-22.04' | |
| args: '' | |
| - platform: 'windows-latest' | |
| args: '' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| - name: Install dependencies (Ubuntu only) | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Install frontend dependencies | |
| run: yarn install | |
| - name: Check signing configuration | |
| shell: bash | |
| run: | | |
| if [ -n "${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}" ]; then | |
| echo "✓ TAURI_SIGNING_PRIVATE_KEY is set" | |
| else | |
| echo "✗ TAURI_SIGNING_PRIVATE_KEY is NOT set" | |
| fi | |
| - uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| tagName: v__VERSION__ | |
| releaseName: 'Dota Keeper v__VERSION__' | |
| releaseBody: 'See the assets below to download this release.' | |
| releaseDraft: true | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| - name: Verify signature files were created | |
| shell: bash | |
| run: | | |
| echo "Checking for .sig files in target directory..." | |
| find src-tauri/target -name "*.sig" -type f || echo "No .sig files found" | |
| update-release-json: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: release | |
| - name: Get version from package.json | |
| id: version | |
| run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Download release signatures | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION="${{ steps.version.outputs.VERSION }}" | |
| echo "Downloading signatures for version v${VERSION}" | |
| # Create signatures directory | |
| mkdir -p ./signatures | |
| # Download from draft release (add || true to not fail if no sigs found) | |
| gh release download "v${VERSION}" --pattern "*.sig" --dir ./signatures || { | |
| echo "Warning: Could not download signature files. They may not exist yet." | |
| echo "This is expected if TAURI_SIGNING_PRIVATE_KEY is not configured." | |
| } | |
| echo "Downloaded signature files:" | |
| ls -la ./signatures/ || echo "No signatures directory or files found" | |
| - name: Update latest.json | |
| run: | | |
| VERSION="${{ steps.version.outputs.VERSION }}" | |
| PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| # Read signatures with better error handling | |
| WIN_SIG="" | |
| LINUX_SIG="" | |
| MACOS_X64_SIG="" | |
| MACOS_ARM_SIG="" | |
| # Windows signature | |
| WIN_SIG_FILE=$(find ./signatures -name "*x64_en-US.msi.zip.sig" -o -name "*x64-setup.exe.sig" | head -n 1) | |
| if [ -n "$WIN_SIG_FILE" ] && [ -f "$WIN_SIG_FILE" ]; then | |
| WIN_SIG=$(cat "$WIN_SIG_FILE") | |
| echo "Found Windows signature: $WIN_SIG_FILE" | |
| else | |
| echo "Warning: Windows signature not found" | |
| fi | |
| # Linux signature | |
| LINUX_SIG_FILE=$(find ./signatures -name "*amd64.AppImage.tar.gz.sig" -o -name "*.AppImage.tar.gz.sig" | head -n 1) | |
| if [ -n "$LINUX_SIG_FILE" ] && [ -f "$LINUX_SIG_FILE" ]; then | |
| LINUX_SIG=$(cat "$LINUX_SIG_FILE") | |
| echo "Found Linux signature: $LINUX_SIG_FILE" | |
| else | |
| echo "Warning: Linux signature not found" | |
| fi | |
| # macOS x64 signature | |
| MACOS_X64_SIG_FILE=$(find ./signatures -name "*x64.app.tar.gz.sig" | head -n 1) | |
| if [ -n "$MACOS_X64_SIG_FILE" ] && [ -f "$MACOS_X64_SIG_FILE" ]; then | |
| MACOS_X64_SIG=$(cat "$MACOS_X64_SIG_FILE") | |
| echo "Found macOS x64 signature: $MACOS_X64_SIG_FILE" | |
| else | |
| echo "Warning: macOS x64 signature not found" | |
| fi | |
| # macOS ARM signature | |
| MACOS_ARM_SIG_FILE=$(find ./signatures -name "*aarch64.app.tar.gz.sig" | head -n 1) | |
| if [ -n "$MACOS_ARM_SIG_FILE" ] && [ -f "$MACOS_ARM_SIG_FILE" ]; then | |
| MACOS_ARM_SIG=$(cat "$MACOS_ARM_SIG_FILE") | |
| echo "Found macOS ARM signature: $MACOS_ARM_SIG_FILE" | |
| else | |
| echo "Warning: macOS ARM signature not found" | |
| fi | |
| # Create meta/autoupdate directory if it doesn't exist | |
| mkdir -p meta/autoupdate | |
| # Update latest.json | |
| cat > meta/autoupdate/latest.json << EOF | |
| { | |
| "version": "${VERSION}", | |
| "notes": "Release v${VERSION}", | |
| "pub_date": "${PUB_DATE}", | |
| "platforms": { | |
| "windows-x86_64": { | |
| "signature": "${WIN_SIG}", | |
| "url": "https://github.com/stringhandler/dota-goals/releases/download/v${VERSION}/dota-keeper_${VERSION}_x64_en-US.msi.zip" | |
| }, | |
| "linux-x86_64": { | |
| "signature": "${LINUX_SIG}", | |
| "url": "https://github.com/stringhandler/dota-goals/releases/download/v${VERSION}/dota-keeper_${VERSION}_amd64.AppImage.tar.gz" | |
| }, | |
| "darwin-x86_64": { | |
| "signature": "${MACOS_X64_SIG}", | |
| "url": "https://github.com/stringhandler/dota-goals/releases/download/v${VERSION}/dota-keeper_x64.app.tar.gz" | |
| }, | |
| "darwin-aarch64": { | |
| "signature": "${MACOS_ARM_SIG}", | |
| "url": "https://github.com/stringhandler/dota-goals/releases/download/v${VERSION}/dota-keeper_aarch64.app.tar.gz" | |
| } | |
| } | |
| } | |
| EOF | |
| echo "Generated latest.json:" | |
| cat meta/autoupdate/latest.json | |
| - name: Upload latest.json to release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION="${{ steps.version.outputs.VERSION }}" | |
| gh release upload "v${VERSION}" meta/autoupdate/latest.json --clobber |