Merge pull request #61 from Gitification-App/main #131
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' | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
publish-tauri: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [macos-latest, ubuntu-20.04, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: install dependencies (ubuntu only) | |
if: matrix.platform == 'ubuntu-20.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libasound2-dev libudev-dev pkg-config libwebkit2gtk-4.0-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf | |
- name: install pnpm | |
run: npm install -g pnpm@8.6.0 | |
- name: install frontend dependencies | |
run: pnpm install | |
- uses: actions/github-script@v6 | |
id: set-args | |
env: | |
RUNS_ON: '${{ matrix.platform }}' | |
with: | |
script: "return process.env.RUNS_ON === 'macos-latest' ? '--target universal-apple-darwin' : ''" | |
result-encoding: string | |
- uses: actions/github-script@v6 | |
id: create-env | |
with: | |
script: | | |
const content = ` | |
VITE_CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} | |
VITE_CLIENT_ID=${{ secrets.CLIENT_ID }} | |
` | |
const root = process.cwd(); | |
const fs = require('fs') | |
fs.writeFileSync('.env', content, 'utf-8') | |
- name: install aarch64-apple-darwin | |
if: matrix.platform == 'macos-latest' | |
run: 'rustup target add aarch64-apple-darwin' | |
- uses: tauri-apps/tauri-action@v0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
with: | |
tagName: __VERSION__ | |
releaseName: '__VERSION__' | |
releaseDraft: false | |
prerelease: false | |
args: ${{ steps.set-args.outputs.result }} |