Use ffurrer2/extract-release-notes@v2 to extract the version section and pass it as releaseBody to the Tauri action. Switch changelog headings to Keep a Changelog format (## [X.Y.Z]) to match the action's expected pattern.
101 lines
2.7 KiB
YAML
101 lines
2.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: macos-latest
|
|
target: aarch64-apple-darwin
|
|
label: macos-arm64
|
|
- platform: macos-latest
|
|
target: x86_64-apple-darwin
|
|
label: macos-x64
|
|
- platform: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
label: windows-x64
|
|
- platform: windows-latest
|
|
target: aarch64-pc-windows-msvc
|
|
label: windows-arm64
|
|
- platform: ubuntu-22.04
|
|
target: x86_64-unknown-linux-gnu
|
|
label: linux-x64
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Install dependencies (Linux)
|
|
if: startsWith(matrix.platform, 'ubuntu')
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- run: bun install
|
|
|
|
- name: Extract release notes
|
|
id: changelog
|
|
uses: ffurrer2/extract-release-notes@v2
|
|
|
|
- name: Build Tauri
|
|
uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY || '' }}
|
|
with:
|
|
tauriScript: bunx tauri
|
|
args: --target ${{ matrix.target }}
|
|
tagName: ${{ github.ref_name }}
|
|
releaseName: 'OpenPencil ${{ github.ref_name }}'
|
|
releaseBody: ${{ steps.changelog.outputs.release_notes }}
|
|
releaseDraft: false
|
|
|
|
publish-npm:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24.x
|
|
registry-url: https://registry.npmjs.org/
|
|
|
|
- run: bun install
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
|
|
- run: cd packages/core && pnpm publish --provenance --access public --no-git-checks
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
- run: cd packages/cli && pnpm publish --provenance --access public --no-git-checks
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
- run: cd packages/mcp && pnpm publish --provenance --access public --no-git-checks
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|