chore(release): v0.1.4 #5
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 | |
| - uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| 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 }} | |
| 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}" | |
| gh release download "v${VERSION}" --pattern "*.sig" --dir ./signatures | |
| echo "Downloaded signature files:" | |
| ls -la ./signatures/ || echo "No signatures 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 | |
| # 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 | |
| - 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 |