Skip to content

publish

publish #62

Workflow file for this run

# See: https://tauri.app/v1/guides/building/cross-platform/#tauri-github-action
# See: https://tauri.app/v1/guides/distribution/sign-macos
name: "publish"
on:
push:
tags:
- "v*"
- "!v*-*"
# workflow_dispatch:
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest"
args: "--target aarch64-apple-darwin"
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04"
args: ""
- platform: "windows-latest"
args: ""
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "pnpm"
- name: Install frontend dependencies
run: pnpm install
- name: Populate the version strings
id: versions
run: |
echo "PUBLIC_VERSION_STRING=$(git describe --tags --always --dirty)" >> $GITHUB_ENV
echo "PUBLIC_TAURI_VERSION=$(pnpm tsx scripts/get-versions.ts | grep PUBLIC_TAURI_VERSION | cut -d= -f2)" >> $GITHUB_ENV
echo "PUBLIC_SVELTE_VERSION=$(pnpm tsx scripts/get-versions.ts | grep PUBLIC_SVELTE_VERSION | cut -d= -f2)" >> $GITHUB_ENV
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
PUBLIC_VERSION_STRING: ${{ env.PUBLIC_VERSION_STRING }}
PUBLIC_TAURI_VERSION: ${{ env.PUBLIC_TAURI_VERSION }}
PUBLIC_SVELTE_VERSION: ${{ env.PUBLIC_SVELTE_VERSION }}
with:
tagName: ${{ github.ref_name }}
releaseName: "Prompta v__VERSION__"
releaseBody: "See the assets to download and install this version."
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
tauriScript: pnpm