release: v0.2.1 — sidecar bundled, download and use #8
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*' | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-latest | |
| target: aarch64-apple-darwin | |
| name: macOS-arm64 | |
| - platform: macos-latest | |
| target: x86_64-apple-darwin | |
| name: macOS-x64 | |
| - platform: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| name: Windows-x64 | |
| - platform: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| name: Linux-x64 | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout source repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './src-tauri -> target' | |
| - name: Install Linux dependencies | |
| 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: npm ci | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Build Python backend sidecar | |
| shell: bash | |
| run: | | |
| cd backend | |
| pip install -e ".[dev]" | |
| pip install pyinstaller | |
| python -m PyInstaller --clean --noconfirm astrolabe-server.spec | |
| mkdir -p ../src-tauri/binaries | |
| if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then | |
| cp dist/astrolabe-server.exe ../src-tauri/binaries/astrolabe-server-${{ matrix.target }}.exe | |
| else | |
| cp dist/astrolabe-server ../src-tauri/binaries/astrolabe-server-${{ matrix.target }} | |
| chmod +x ../src-tauri/binaries/astrolabe-server-${{ matrix.target }} | |
| fi | |
| ls -la ../src-tauri/binaries/ | |
| - name: Configure Tauri for release | |
| shell: bash | |
| run: | | |
| # Add externalBin to tauri.conf.json | |
| node -e " | |
| const fs = require('fs'); | |
| const conf = JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json', 'utf8')); | |
| conf.bundle.externalBin = ['binaries/astrolabe-server']; | |
| fs.writeFileSync('src-tauri/tauri.conf.json', JSON.stringify(conf, null, 2)); | |
| console.log('Added externalBin to tauri.conf.json'); | |
| " | |
| # Add sidecar permission to capabilities | |
| node -e " | |
| const fs = require('fs'); | |
| const cap = JSON.parse(fs.readFileSync('src-tauri/capabilities/default.json', 'utf8')); | |
| for (let perm of cap.permissions) { | |
| if (typeof perm === 'object' && perm.identifier === 'shell:allow-spawn') { | |
| const hasSidecar = perm.allow.some(a => a.name === 'astrolabe-server'); | |
| if (!hasSidecar) { | |
| perm.allow.push({ name: 'astrolabe-server', sidecar: true }); | |
| console.log('Added sidecar permission to capabilities'); | |
| } | |
| break; | |
| } | |
| } | |
| fs.writeFileSync('src-tauri/capabilities/default.json', JSON.stringify(cap, null, 2)); | |
| " | |
| - name: Build Tauri app | |
| 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: | |
| args: --target ${{ matrix.target }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifacts-${{ matrix.name }} | |
| path: | | |
| src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg | |
| src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app.tar.gz | |
| src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app.tar.gz.sig | |
| src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi | |
| src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*.exe | |
| src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb | |
| src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Display artifacts | |
| run: find artifacts -type f | head -50 | |
| - name: Generate updater JSON | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| # Find signature files | |
| MACOS_SIG_FILE=$(find artifacts -name "*.app.tar.gz.sig" | head -1) | |
| MACOS_SIG="" | |
| if [ -n "$MACOS_SIG_FILE" ]; then | |
| MACOS_SIG=$(cat "$MACOS_SIG_FILE") | |
| fi | |
| BASE_URL="https://github.com/factorin-dev/Astrolabe/releases/download/${GITHUB_REF_NAME}" | |
| cat > latest.json << EOF | |
| { | |
| "version": "${VERSION}", | |
| "notes": "See release notes on GitHub", | |
| "pub_date": "${DATE}", | |
| "platforms": { | |
| "darwin-aarch64": { | |
| "signature": "${MACOS_SIG}", | |
| "url": "${BASE_URL}/Astrolabe.app.tar.gz" | |
| }, | |
| "darwin-x86_64": { | |
| "signature": "${MACOS_SIG}", | |
| "url": "${BASE_URL}/Astrolabe.app.tar.gz" | |
| } | |
| } | |
| } | |
| EOF | |
| cat latest.json | |
| - name: Collect release files | |
| run: | | |
| mkdir -p release-files | |
| # Copy macOS files | |
| find artifacts -name "*.dmg" -exec cp {} release-files/ \; | |
| find artifacts -name "*.app.tar.gz" -exec cp {} release-files/ \; | |
| find artifacts -name "*.app.tar.gz.sig" -exec cp {} release-files/ \; | |
| # Copy Windows files | |
| find artifacts -name "*.msi" -exec cp {} release-files/ \; | |
| find artifacts -name "*.exe" -exec cp {} release-files/ \; | |
| # Copy Linux files | |
| find artifacts -name "*.deb" -exec cp {} release-files/ \; | |
| find artifacts -name "*.AppImage" -exec cp {} release-files/ \; | |
| # Copy updater JSON | |
| cp latest.json release-files/ | |
| ls -la release-files/ | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Astrolabe ${{ github.ref_name }} | |
| body: | | |
| ## Astrolabe ${{ github.ref_name }} | |
| ### Downloads | |
| | Platform | Download | | |
| |----------|----------| | |
| | macOS (Apple Silicon) | `Astrolabe_*_aarch64.dmg` | | |
| | macOS (Intel) | `Astrolabe_*_x64.dmg` | | |
| | Windows | `Astrolabe_*_x64-setup.exe` or `.msi` | | |
| | Linux | `Astrolabe_*_amd64.deb` or `.AppImage` | | |
| ### macOS Users | |
| On first launch, macOS may show "damaged and can't be opened" because the app is not notarized by Apple. | |
| **Fix (choose one):** | |
| 1. Run in Terminal: | |
| ```bash | |
| xattr -cr /Applications/Astrolabe.app | |
| ``` | |
| 2. Or: Right-click the app → Open → Confirm Open | |
| ### Linux Users | |
| For `.AppImage`, make it executable: `chmod +x Astrolabe_*.AppImage` | |
| ### Auto-Update | |
| The `latest.json` file is used for Tauri's built-in updater. | |
| files: release-files/* | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, '-') }} |