Skip to content

Commit

Permalink
update build yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjj1024 committed Dec 25, 2024
1 parent 0d7fa58 commit 9403285
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 50 deletions.
File renamed without changes.
50 changes: 30 additions & 20 deletions .github/workflows/auto.yml → .github/back/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: 'publish'

name: Release
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the workflow on'
required: true
default: 'template'

jobs:
publish-tauri:
Expand All @@ -19,14 +24,9 @@ jobs:
- platform: 'macos-latest' # for Intel based macs.
target: 'x86_64-apple-darwin'
args: '--target x86_64-apple-darwin'

- platform: 'ubuntu-20.04'
target: 'x86_64-unknown-linux-gnu'
args: ''
- platform: 'ubuntu-20.04'
target: 'aarch64-unknown-linux-gnu'
args: ''

- platform: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
- platform: 'windows-latest'
Expand All @@ -36,13 +36,20 @@ jobs:
args: '--target aarch64-pc-windows-msvc'

runs-on: ${{ matrix.platform }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v3

- name: Install rust target
run: rustup target add ${{ matrix.target }}

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -52,33 +59,36 @@ jobs:
with:
version: latest

# 获取 pnpm 缓存
- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly
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-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-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 # change this to npm, pnpm or bun depending on which one you use.
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: pnpm install # change this to npm or pnpm depending on which one you use.

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: PakePlus-v__VERSION__
tagName: ${{ github.ref_name }}
releaseName: 'PakePlus v__VERSION__'
body_path: ./Note.md
releaseDraft: true
releaseDraft: false
prerelease: false
publish: true
args: ${{ matrix.args }}
50 changes: 20 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
name: Release
name: 'publish'

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the workflow on'
required: true
default: 'template'
branches:
- main

jobs:
publish-tauri:
Expand All @@ -24,9 +19,14 @@ jobs:
- platform: 'macos-latest' # for Intel based macs.
target: 'x86_64-apple-darwin'
args: '--target x86_64-apple-darwin'

- platform: 'ubuntu-20.04'
target: 'x86_64-unknown-linux-gnu'
args: ''
- platform: 'ubuntu-20.04'
target: 'aarch64-unknown-linux-gnu'
args: ''

- platform: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
- platform: 'windows-latest'
Expand All @@ -36,20 +36,13 @@ jobs:
args: '--target aarch64-pc-windows-msvc'

runs-on: ${{ matrix.platform }}
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install rust target
run: rustup target add ${{ matrix.target }}

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -59,36 +52,33 @@ jobs:
with:
version: latest

# 获取 pnpm 缓存
- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly
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: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: pnpm install # change this to npm or pnpm depending on which one you use.
run: pnpm install # change this to npm, pnpm or bun depending on which one you use.

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
tagName: PakePlus-v__VERSION__
releaseName: 'PakePlus v__VERSION__'
body_path: ./Note.md
releaseDraft: false
releaseDraft: true
prerelease: false
publish: true
args: ${{ matrix.args }}

0 comments on commit 9403285

Please sign in to comment.