Release Build #7
This file contains 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: | |
workflow_dispatch: | |
permissions: write-all | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUST_BACKTRACE: short | |
jobs: | |
release: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
- os: windows-latest | |
target: aarch64-pc-windows-msvc | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Rust Stable | |
uses: dtolnay/rust-toolchain@1.77.0 | |
- name: Add Rust Target | |
run: rustup target add ${{ matrix.target }} | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: src-tauri | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- uses: pnpm/action-setup@v4 | |
name: Install with pnpm | |
with: | |
run_install: true | |
- name: Tauri build | |
uses: tauri-apps/tauri-action@v0 | |
env: | |
NODE_OPTIONS: --max_old_space_size=4096 | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
with: | |
tagName: v__VERSION__ | |
releaseName: KeyEcho v__VERSION__ | |
tauriScript: pnpm | |
args: --target ${{ matrix.target }} | |
release-for-linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: armv7-unknown-linux-gnueabihf | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Build for Linux | |
uses: ./.github/build-for-linux | |
env: | |
NODE_OPTIONS: --max_old_space_size=4096 | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
with: | |
target: ${{ matrix.target }} | |
- name: Get Version | |
run: | | |
cargo install toml-cli | |
echo "VERSION=$(toml get src-tauri/Cargo.toml package.version | tr -d '"')" >> $GITHUB_ENV | |
- name: Upload Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{env.VERSION}} | |
name: 'KeyEcho v${{env.VERSION}}' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb | |
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm | |
release-update: | |
runs-on: ubuntu-latest | |
needs: [release, release-for-linux] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- uses: pnpm/action-setup@v4 | |
name: Install with pnpm | |
with: | |
run_install: true | |
- name: Release updater file | |
run: pnpm updater | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |