Skip to content

Commit

Permalink
feat: github release
Browse files Browse the repository at this point in the history
  • Loading branch information
npv2k1 committed Nov 3, 2023
1 parent 92119af commit 4dbe06e
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Generate changelog
id: create_release
run: npx changelogithub --draft --name pntools-${{ steps.vars.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-app:
needs: create-release
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]

runs-on: ${{ matrix.platform }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: latest

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
- name: install dependencies (mac only)
if: matrix.platform == 'macos-latest'
run: |
rustup target add aarch64-apple-darwin
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'pnpm'

- name: Install app dependencies and build web
run: pnpm install --frozen-lockfile

- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
releaseName: pntools ${{ needs.create-release.outputs.APP_VERSION }}
releaseBody: ''
releaseDraft: true
prerelease: false

0 comments on commit 4dbe06e

Please sign in to comment.