134 lines
5.0 KiB
YAML
134 lines
5.0 KiB
YAML
name: 'release'
|
|
|
|
on:
|
|
workflow_dispatch
|
|
|
|
jobs:
|
|
release-tauri:
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: 'macos-latest'
|
|
args: '--target aarch64-apple-darwin'
|
|
arch: 'silicon'
|
|
type: 'aarch64'
|
|
- platform: 'macos-latest'
|
|
args: '--target x86_64-apple-darwin'
|
|
arch: 'silicon'
|
|
type: 'x86_64'
|
|
- platform: 'ubuntu-22.04'
|
|
args: ''
|
|
- platform: 'windows-latest'
|
|
args: '--target x86_64-pc-windows-msvc'
|
|
arch: 'arm64'
|
|
type: 'x86_64'
|
|
- platform: "windows-latest"
|
|
args: "--target aarch64-pc-windows-msvc"
|
|
arch: 'arm64'
|
|
type: 'aarch64'
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
env:
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: setup node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'npm'
|
|
|
|
- name: install Rust stable (linux only)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
|
|
- name: install Rust stable (macos only)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
if: matrix.platform == 'macos-latest'
|
|
with:
|
|
targets: ${{ matrix.type == 'aarch64' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}
|
|
|
|
- name: install Rust stable (windows only)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
if: matrix.platform == 'windows-latest'
|
|
with:
|
|
targets: ${{ matrix.type == 'aarch64' && 'aarch64-pc-windows-msvc' || 'x86_64-pc-windows-msvc' }}
|
|
|
|
- name: Rust cache
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: './src-tauri -> target'
|
|
|
|
- name: install dependencies (linux 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.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: install dependencies (windows only)
|
|
if: matrix.platform == 'windows-latest'
|
|
run: |
|
|
cargo install --force trusted-signing-cli --version 0.5.0
|
|
|
|
- name: install frontend dependencies
|
|
run: npm install
|
|
|
|
- name: Import Apple Developer Certificate (macos only)
|
|
if: matrix.platform == 'macos-latest'
|
|
env:
|
|
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
run: |
|
|
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
|
|
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
|
|
security default-keychain -s build.keychain
|
|
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
|
|
security set-keychain-settings -t 3600 -u build.keychain
|
|
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
|
|
security find-identity -v -p codesigning build.keychain
|
|
|
|
- name: Verify Certificate (macos only)
|
|
if: matrix.platform == 'macos-latest'
|
|
run: |
|
|
CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application")
|
|
CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
|
|
echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
|
|
echo "Certificate imported."
|
|
|
|
- uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# for windows signing
|
|
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
|
|
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
|
|
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
|
|
|
|
# for macos signing
|
|
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }}
|
|
|
|
# for macos notarization
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
APPLE_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
|
|
# for updates
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
with:
|
|
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
|
|
releaseName: 'v__VERSION__'
|
|
releaseBody: 'See the assets to download this version and install.'
|
|
releaseDraft: true
|
|
prerelease: false
|
|
args: ${{ matrix.args }}
|