From 9403285ecfaef7a21997ff01a563544671fa92b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?1024=E5=B0=8F=E7=A5=9E?= <15670339118@163.com> Date: Wed, 25 Dec 2024 13:56:15 +0800 Subject: [PATCH] update build yaml --- .github/{workflows => back}/beta_build.yml | 0 .../{workflows/auto.yml => back/build.yml} | 50 +++++++++++-------- .github/workflows/build.yml | 50 ++++++++----------- 3 files changed, 50 insertions(+), 50 deletions(-) rename .github/{workflows => back}/beta_build.yml (100%) rename .github/{workflows/auto.yml => back/build.yml} (63%) diff --git a/.github/workflows/beta_build.yml b/.github/back/beta_build.yml similarity index 100% rename from .github/workflows/beta_build.yml rename to .github/back/beta_build.yml diff --git a/.github/workflows/auto.yml b/.github/back/build.yml similarity index 63% rename from .github/workflows/auto.yml rename to .github/back/build.yml index eb9442fd..0378aeda 100644 --- a/.github/workflows/auto.yml +++ b/.github/back/build.yml @@ -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: @@ -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' @@ -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: @@ -52,6 +59,7 @@ jobs: with: version: latest + # 获取 pnpm 缓存 - name: Sync node version and setup cache uses: actions/setup-node@v4 with: @@ -59,26 +67,28 @@ jobs: 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 }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0378aeda..eb9442fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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' @@ -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: @@ -59,7 +52,6 @@ jobs: with: version: latest - # 获取 pnpm 缓存 - name: Sync node version and setup cache uses: actions/setup-node@v4 with: @@ -67,28 +59,26 @@ jobs: 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 }}