diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 82373d0..97076a5 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [windows-latest, ubuntu-22.04] + platform: [windows-latest, macos-latest, ubuntu-22.04] steps: - name: Checkout @@ -50,3 +50,6 @@ jobs: - name: Build run: yarn build + - name: Rust tests + run: cargo test --manifest-path src-tauri/Cargo.toml + diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 6f42588..569acd1 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -69,7 +69,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [windows-latest, ubuntu-22.04] + platform: [windows-latest, macos-latest, ubuntu-22.04] steps: - name: Checkout (tag) @@ -98,7 +98,7 @@ jobs: if: matrix.platform == 'ubuntu-22.04' run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf + sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf rpm - name: Install frontend dependencies run: yarn install --frozen-lockfile @@ -106,6 +106,9 @@ jobs: - name: Quick web build run: yarn build + - name: Rust tests + run: cargo test --manifest-path src-tauri/Cargo.toml + - name: Build Tauri app and publish prerelease assets uses: tauri-apps/tauri-action@v0 env: @@ -116,3 +119,30 @@ jobs: prerelease: true tagName: ${{ needs.prepare.outputs.tag_name }} releaseName: EndCat ${{ needs.prepare.outputs.tag_name }} + + - name: Create portable exe (Windows) + if: matrix.platform == 'windows-latest' + shell: pwsh + run: | + $version = "${{ needs.prepare.outputs.app_version }}" + $exe = "src-tauri/target/release/endfield-cat.exe" + if (-not (Test-Path -LiteralPath $exe)) { + throw "Missing binary: $exe" + } + + $outDir = "src-tauri/target/release/bundle/portable" + New-Item -ItemType Directory -Force -Path $outDir | Out-Null + $portableExe = Join-Path $outDir ("endfield-cat_{0}_x64_portable.exe" -f $version) + Copy-Item -LiteralPath $exe -Destination $portableExe -Force + + "PORTABLE_EXE=$portableExe" >> $env:GITHUB_ENV + + - name: Upload portable exe to release (Windows) + if: matrix.platform == 'windows-latest' + shell: pwsh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $tag = "${{ needs.prepare.outputs.tag_name }}" + if (-not $env:PORTABLE_EXE) { throw "PORTABLE_EXE env is not set" } + gh release upload $tag "$env:PORTABLE_EXE" --clobber --repo "$env:GITHUB_REPOSITORY" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c65e0b1..761210e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [windows-latest, ubuntu-22.04] + platform: [windows-latest, macos-latest, ubuntu-22.04] steps: - name: Checkout (tag) @@ -94,7 +94,7 @@ jobs: if: matrix.platform == 'ubuntu-22.04' run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf + sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf rpm - name: Install frontend dependencies run: yarn install --frozen-lockfile @@ -102,6 +102,9 @@ jobs: - name: Quick web build run: yarn build + - name: Rust tests + run: cargo test --manifest-path src-tauri/Cargo.toml + - name: Build Tauri app and create draft release uses: tauri-apps/tauri-action@v0 env: @@ -112,3 +115,30 @@ jobs: prerelease: false tagName: ${{ needs.prepare.outputs.tag_name }} releaseName: EndCat ${{ needs.prepare.outputs.tag_name }} + + - name: Create portable exe (Windows) + if: matrix.platform == 'windows-latest' + shell: pwsh + run: | + $version = "${{ needs.prepare.outputs.app_version }}" + $exe = "src-tauri/target/release/endfield-cat.exe" + if (-not (Test-Path -LiteralPath $exe)) { + throw "Missing binary: $exe" + } + + $outDir = "src-tauri/target/release/bundle/portable" + New-Item -ItemType Directory -Force -Path $outDir | Out-Null + $portableExe = Join-Path $outDir ("endfield-cat_{0}_x64_portable.exe" -f $version) + Copy-Item -LiteralPath $exe -Destination $portableExe -Force + + "PORTABLE_EXE=$portableExe" >> $env:GITHUB_ENV + + - name: Upload portable exe to release (Windows) + if: matrix.platform == 'windows-latest' + shell: pwsh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $tag = "${{ needs.prepare.outputs.tag_name }}" + if (-not $env:PORTABLE_EXE) { throw "PORTABLE_EXE env is not set" } + gh release upload $tag "$env:PORTABLE_EXE" --clobber --repo "$env:GITHUB_REPOSITORY" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 54d4bff..330a549 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -38,7 +38,13 @@ }, "bundle": { "active": true, - "targets": "all", + "targets": [ + "nsis", + "dmg", + "deb", + "rpm", + "appimage" + ], "icon": [ "icons/32x32.png", "icons/128x128.png", @@ -47,4 +53,4 @@ "icons/icon.ico" ] } -} \ No newline at end of file +}