Skip to content

update version

update version #19

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
create_release:
description: "Create new release"
required: true
type: boolean
default: false
jobs:
create-release:
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
if: github.event_name == 'workflow_dispatch' && inputs.create_release || startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Get version
id: get-version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
else
node -p "require('./package.json').version" > version.txt
echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT
fi
- name: Create Release
if: github.event_name == 'workflow_dispatch' && inputs.create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(node -p "require('./package.json').version")
gh release create "v$VERSION" --draft --title "v$VERSION" --notes "Release v$VERSION"
build:
needs: create-release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
- windows-latest
- macos-latest
include:
- platform: ubuntu-latest
buildCommand: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf \
libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libsoup-3.0-0 webkit2gtk-4.1-dev
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: pnpm/action-setup@v2
with:
version: "8"
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: dtolnay/rust-toolchain@stable
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: ${{ matrix.buildCommand }}
- name: Install frontend dependencies
run: pnpm install
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v${{ needs.create-release.outputs.version }}
releaseName: "App v${{ needs.create-release.outputs.version }}"
releaseBody: "Release v${{ needs.create-release.outputs.version }}"
releaseDraft: true
prerelease: false