Skip to content

Commit

Permalink
chore: port dev build action to release build
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko233 committed Dec 24, 2023
1 parent 517e166 commit 2a39be3
Showing 1 changed file with 48 additions and 12 deletions.
60 changes: 48 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,25 @@ jobs:
release:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-13]

runs-on: ${{ matrix.os }}
targets:
- os: windows-latest
category: nsis
- os: windows-latest
category: msi
- os: ubuntu-latest
category: all
- os: macos-13
category: amd64
- os: macos-13
category: aarch64

runs-on: ${{ matrix.targets.os }}
if: startsWith(github.repository, 'keiko233')
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
Expand All @@ -29,10 +41,10 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
key: ${{ matrix.os }}
key: ${{ matrix.targets.os }}

- name: Install the missing rust target (macOS Only)
if: startsWith(matrix.os, 'macos-')
if: startsWith(matrix.targets.os, 'macos-')
run: |
rustup target add aarch64-apple-darwin
Expand All @@ -47,21 +59,43 @@ jobs:
version: 8
run_install: false

- name: Delete current release assets
if: startsWith(matrix.targets.os, 'ubuntu-')
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.GH_TOKEN }}
tag: v__VERSION__
fail-if-no-assets: false
fail-if-no-release: false
assets: |
*.zip
*.gz
*.AppImage
*.deb
*.dmg
*.msi
*.sig
*.exe
*.json
- name: Install Dependencies (Ubuntu Only)
if: startsWith(matrix.os, 'ubuntu-')
if: startsWith(matrix.targets.os, 'ubuntu-')
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf openssl
- uses: maxim-lobanov/setup-xcode@v1
if: startsWith(matrix.os, 'macos-')
if: startsWith(matrix.targets.os, 'macos-')
with:
xcode-version: "15.0"

- name: Pnpm install and check
run: |
pnpm i
pnpm check
- name: Tauri build
if: startsWith(matrix.targets.os, 'macos-') == false || matrix.targets.category != 'aarch64'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand All @@ -73,27 +107,29 @@ jobs:
releaseBody: "More new features are now supported."
releaseDraft: false
prerelease: false
tauriScript: pnpm
args: -f default-meta
tauriScript: pnpm tauri
args: -f default-meta -c ./backend/tauri/tauri.conf.json

- name: Portable Bundle (Windows Only)
if: matrix.os == 'windows-latest'
if: startsWith(matrix.targets.os, 'windows-') && matrix.targets.category == 'nsis'
run: |
pnpm portable
env:
TAG_NAME: v__VERSION__
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_WIN_PORTABLE: 1

- name: Pnpm check (macOS aarch64)
if: startsWith(matrix.os, 'macos-')
if: startsWith(matrix.targets.os, 'macos-') && matrix.targets.category == 'aarch64'
run: |
pnpm check --arch arm64 --sidecar-host aarch64-apple-darwin
- name: Tauri build with Upload (macOS aarch64)
if: startsWith(matrix.os, 'macos-')
if: startsWith(matrix.targets.os, 'macos-') && matrix.targets.category == 'aarch64'
env:
TAG_NAME: v__VERSION__
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
Expand Down

0 comments on commit 2a39be3

Please sign in to comment.