release: bump version (#126) #154
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: | |
name: Covector | |
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 }} | |
version: ${{ steps.get-release-version.outputs.version }} | |
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 }} | |
- name: Get Release Version | |
id: get-release-version | |
if: steps.covector.outputs.commandRan == 'publish' | |
run: echo "version=$(cat .version)" >> "$GITHUB_OUTPUT" | |
release-tauri: | |
needs: version-or-publish | |
if: needs.version-or-publish.outputs.releaseId | |
permissions: | |
contents: write | |
name: Release ${{ needs.version-or-publish.outputs.version }} on ${{ matrix.platform }} | |
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 --bundles nsis" | |
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 nightly | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: nightly | |
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 | |
with: | |
workspaces: "./src-tauri -> target" | |
- name: Install frontend dependencies | |
run: pnpm install | |
- name: Bump Tauri version | |
run: pnpm version:bump tauri --version ${{ needs.version-or-publish.outputs.version }} | |
- uses: tauri-apps/tauri-action@v0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
releaseId: ${{ needs.version-or-publish.outputs.releaseId }} | |
args: ${{ matrix.args }} | |
updaterJsonPreferNsis: true | |
release-aur: | |
needs: [release-tauri, version-or-publish] | |
if: needs.version-or-publish.outputs.successfulPublish | |
name: Publish to AUR | |
runs-on: ubuntu-latest | |
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 dependencies | |
run: pnpm install | |
- name: Install Makepkg | |
run: sudo apt-get update && sudo apt-get install -y makepkg pacman | |
- name: Publish to AUR | |
run: pnpm publish:aur --version ${{ needs.version-or-publish.outputs.version }} --ci | |
env: | |
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} |