Files
dumpsterChat/.github/workflows/release.yml
T

101 lines
3.1 KiB
YAML

name: Release Desktop Apps
on:
push:
tags: ['v*']
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- name: Cache npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('web/package-lock.json') }}
- uses: dtolnay/rust-toolchain@stable
- name: Cache Rust target and registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
web/src-tauri/target
key: ${{ runner.os }}-cargo-${{ hashFiles('web/src-tauri/Cargo.lock') }}
- name: Install system deps
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf rpm
- name: Build frontend
run: cd web && npm ci && npm run build
- name: Build Tauri bundles
env:
NO_STRIP: "true"
run: cd web && npx tauri build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: linux-bundles
path: |
web/src-tauri/target/release/bundle/appimage/*.AppImage
web/src-tauri/target/release/bundle/deb/*.deb
web/src-tauri/target/release/bundle/rpm/*.rpm
build-windows:
runs-on: windows
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- name: Cache npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('web/package-lock.json') }}
- name: Install Rust
run: |
curl.exe -sLo rustup-init.exe https://win.rustup.rs/x86_64
rustup-init.exe -y --default-toolchain stable --profile minimal
set PATH=%USERPROFILE%\.cargo\bin;%PATH%
rustc --version
shell: cmd
- name: Cache Rust target and registry
uses: Swatinem/rust-cache@v2
with:
workspaces: |
web/src-tauri
- name: Build frontend
run: cd web && npm ci && npm run build
shell: cmd
- name: Build Tauri bundles
env:
CI: "true"
run: cd web && set PATH=%USERPROFILE%\.cargo\bin;%PATH% && npx tauri build
shell: cmd
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: windows-bundles
path: |
web/src-tauri/target/release/bundle/msi/*.msi
web/src-tauri/target/release/bundle/nsis/*.exe
release:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: Create release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
files: |
linux-bundles/**/*.AppImage
linux-bundles/**/*.deb
linux-bundles/**/*.rpm
windows-bundles/**/*.msi
windows-bundles/**/*.exe