Merge pull request #19 from Y-RyuZU/tauri #25
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: Build and Release | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| env: | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run linting | |
| run: bun run lint | |
| - name: Run type checking | |
| run: bun run typecheck | |
| - name: Run tests | |
| run: bun run test:jest | |
| - name: Setup tmate session (for debugging) | |
| if: failure() || github.event_name == 'workflow_dispatch' | |
| uses: mxschmitt/action-tmate@v3 | |
| timeout-minutes: 3 | |
| build: | |
| name: Build - ${{ matrix.platform.target }} | |
| needs: test | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} # Repository Secret | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| bundles: appimage,deb | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| bundles: dmg | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| bundles: dmg | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| bundles: nsis,msi | |
| runs-on: ${{ matrix.platform.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform.target }} | |
| - name: Install system dependencies (Ubuntu) | |
| if: matrix.platform.os == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| src-tauri/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Cache Node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install frontend dependencies | |
| run: bun install | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --bundles ${{ matrix.platform.bundles }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: minecraft-mods-localizer-${{ matrix.platform.target }} | |
| path: | | |
| src-tauri/target/release/bundle/**/*.AppImage | |
| src-tauri/target/release/bundle/**/*.deb | |
| src-tauri/target/release/bundle/**/*.dmg | |
| src-tauri/target/release/bundle/**/*.exe | |
| src-tauri/target/release/bundle/**/*.msi | |
| retention-days: 7 | |
| release: | |
| name: Create Release | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| prerelease: false | |
| generate_release_notes: true | |
| files: | | |
| artifacts/**/*.AppImage | |
| artifacts/**/*.deb | |
| artifacts/**/*.dmg | |
| artifacts/**/*.exe | |
| artifacts/**/*.msi | |
| body: | | |
| ## What's Changed | |
| <!-- Add your release notes here --> | |
| ## Installation | |
| ### Windows | |
| - Download the `.exe` or `.msi` installer for your system | |
| ### macOS | |
| - Download the `.dmg` file for your architecture (Intel or Apple Silicon) | |
| ### Linux | |
| - Download the `.AppImage` (universal) or `.deb` (Debian/Ubuntu) package | |
| ## Checksums | |
| <!-- Checksums will be automatically generated --> |