feat: staging area, split panes, AppData persistence, CI/CD workflows… #1
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| bundles: nsis,msi | |
| # Uncomment when macOS/Linux builds are ready: | |
| # - os: ubuntu-22.04 | |
| # bundles: appimage,deb | |
| # - os: macos-latest | |
| # bundles: dmg,app | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> src-tauri/target | |
| - run: npm ci | |
| - name: Build | |
| run: npx tauri build --bundles ${{ matrix.bundles }} | |
| env: | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| - name: Upload Windows artifacts | |
| if: matrix.os == 'windows-latest' | |
| shell: bash | |
| run: | | |
| shopt -s nullglob | |
| files=( | |
| "src-tauri/target/release/tempest.exe" | |
| src-tauri/target/release/bundle/nsis/*.exe | |
| src-tauri/target/release/bundle/nsis/*.exe.sig | |
| src-tauri/target/release/bundle/msi/*.msi | |
| ) | |
| gh release upload ${{ github.ref_name }} "${files[@]}" --clobber | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Uncomment when Linux build is added to matrix: | |
| # - name: Upload Linux artifacts | |
| # if: matrix.os == 'ubuntu-22.04' | |
| # shell: bash | |
| # run: | | |
| # shopt -s nullglob | |
| # files=( | |
| # src-tauri/target/release/bundle/deb/*.deb | |
| # src-tauri/target/release/bundle/appimage/*.AppImage | |
| # src-tauri/target/release/bundle/appimage/*.AppImage.sig | |
| # ) | |
| # gh release upload ${{ github.ref_name }} "${files[@]}" --clobber | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Uncomment when macOS build is added to matrix: | |
| # - name: Upload macOS artifacts | |
| # if: matrix.os == 'macos-latest' | |
| # shell: bash | |
| # run: | | |
| # shopt -s nullglob | |
| # files=( | |
| # src-tauri/target/release/bundle/dmg/*.dmg | |
| # src-tauri/target/release/bundle/macos/*.app.tar.gz | |
| # src-tauri/target/release/bundle/macos/*.app.tar.gz.sig | |
| # ) | |
| # gh release upload ${{ github.ref_name }} "${files[@]}" --clobber | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download signatures | |
| run: | | |
| gh release download ${{ github.ref_name }} \ | |
| --pattern "*.sig" \ | |
| --dir sigs \ | |
| --repo gsvprharsha/tempest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate and upload latest.json | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| python3 << 'PYEOF' | |
| import json, os, glob, datetime, subprocess | |
| tag = os.environ["TAG"] | |
| version = tag.lstrip("v") | |
| base_url = f"https://github.com/gsvprharsha/tempest/releases/download/{tag}" | |
| def read_sig(pattern): | |
| files = glob.glob(f"sigs/{pattern}") | |
| return open(files[0]).read().strip() if files else None | |
| platforms = {} | |
| sig = read_sig(f"*{version}*x64-setup.exe.sig") | |
| if sig: | |
| platforms["windows-x86_64"] = { | |
| "signature": sig, | |
| "url": f"{base_url}/tempest_{version}_x64-setup.exe" | |
| } | |
| manifest = { | |
| "version": version, | |
| "notes": f"https://github.com/gsvprharsha/tempest/releases/tag/{tag}", | |
| "pub_date": datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"), | |
| "platforms": platforms, | |
| } | |
| print(json.dumps(manifest, indent=2)) | |
| with open("latest.json", "w") as f: | |
| json.dump(manifest, f, indent=2) | |
| subprocess.run( | |
| ["gh", "release", "upload", tag, "latest.json", "--clobber", | |
| "--repo", "gsvprharsha/tempest"], | |
| check=True, | |
| env=os.environ, | |
| ) | |
| PYEOF |