Publish Release #52
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: 'Publish Release' | |
on: | |
workflow_dispatch: | |
inputs: | |
vendor_version: | |
type: string | |
description: "Vendor Version (semver) for the release -- what will be visible." | |
default: "0.0.1" | |
required: true | |
jobs: | |
create_release_tag: | |
name: "Create release tag" | |
env: | |
VENDOR_VERSION: ${{ github.event.inputs.vendor_version || '0.0.1' }} | |
runs-on: ubuntu-latest | |
outputs: | |
release_id: ${{ steps.create_release.outputs.id }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- uses: softprops/action-gh-release@v2 | |
id: create_release | |
name: Create release and add tauri-update.json | |
with: | |
tag_name: "v${{ env.VENDOR_VERSION }}" | |
name: "v${{ env.VENDOR_VERSION }}" | |
body: "v${{ env.VENDOR_VERSION }}" | |
prerelease: false | |
draft: true | |
fail_on_unmatched_files: true | |
publish-tauri: | |
needs: create_release_tag | |
env: | |
RELEASE_ID: ${{ needs.create_release_tag.outputs.release_id }} | |
VENDOR_VERSION: ${{ github.event.inputs.vendor_version || '0.0.1' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: 'macos-latest' # for Arm based macs (M1 and above). | |
args: '--target aarch64-apple-darwin' | |
- platform: 'macos-latest' # for Intel based macs. | |
args: '--target x86_64-apple-darwin' | |
- platform: 'ubuntu-22.04' | |
args: '' | |
- platform: 'windows-latest' | |
args: '' | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: git tag ${{ github.event.inputs.tag }} | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. | |
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
- name: install dependencies (ubuntu only) | |
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2. We will remove 4.0 once Tauri V2 launches. | |
- name: install Ubuntu Dependencies | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: './src-tauri -> target' | |
- name: install app dependencies and build it | |
run: npm install && npm run build | |
- uses: tauri-apps/tauri-action@dev | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
with: | |
releaseId: ${{ env.RELEASE_ID }} | |
releaseDraft: true | |
prerelease: true | |
args: ${{ matrix.args }} |