fix: fix ci platform #30
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: Version or publish | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
# required for npm provenance | |
id-token: write | |
# required to create the GitHub Release | |
contents: write | |
# required for creating the Version Packages Release | |
pull-requests: write | |
jobs: | |
version-or-publish: | |
runs-on: ubuntu-latest | |
timeout-minutes: 65 | |
outputs: | |
change: ${{ steps.covector.outputs.change }} | |
commandRan: ${{ steps.covector.outputs.commandRan }} | |
releaseId: ${{ steps.covector.outputs.releaseId }} | |
successfulPublish: ${{ steps.covector.outputs.successfulPublish }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # required for use of git history | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- uses: actions/setup-node@v4 | |
with: | |
registry-url: "https://registry.npmjs.org" | |
- name: git config | |
run: | | |
git config --global user.name "${{ github.event.pusher.name }}" | |
git config --global user.email "${{ github.event.pusher.email }}" | |
- name: covector version or publish (publish when no change files present) | |
uses: jbolda/covector/packages/[email protected] | |
id: covector | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
command: "version-or-publish" | |
createRelease: true | |
recognizeContributors: true | |
- name: Create Pull Request With Versions Bumped | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
if: steps.covector.outputs.commandRan == 'version' | |
with: | |
title: "release: bump version" | |
commit-message: "chore: publish new versions" | |
labels: "version updates" | |
branch: "release" | |
body: ${{ steps.covector.outputs.change }} | |
release-tauri: | |
needs: version-or-publish | |
if: needs.version-or-publish.outputs.successfulPublish == 'true' | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: "macos-latest" # for Arm based macs (M1 and above). | |
args: "--target aarch64-apple-darwin" | |
target: "aarch64-apple-darwin" | |
- platform: "macos-latest" # for Intel based macs. | |
args: "--target x86_64-apple-darwin" | |
target: "x86_64-apple-darwin" | |
- platform: "ubuntu-22.04" | |
args: "" | |
target: "" | |
- platform: "windows-latest" | |
args: "--target x86_64-pc-windows-msvc" | |
target: "x86_64-pc-windows-msvc" | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
targets: ${{ matrix.target }} | |
- 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 libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install frontend dependencies | |
run: pnpm install | |
- uses: tauri-apps/tauri-action@v0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CC: ${{ matrix.platform == 'macos-latest' && 'clang' || 'gcc' }} | |
with: | |
releaseId: ${{ needs.version-or-publish.outputs.releaseId }} | |
args: ${{ matrix.args }} |