fix(actions):调整Github Action。
This commit is contained in:
parent
5a191e3c4d
commit
e7c481afa6
68
.github/workflows/release.yml
vendored
68
.github/workflows/release.yml
vendored
|
@ -41,19 +41,17 @@ jobs:
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
# 安装 Node.js
|
# 安装 Node.js
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
|
|
||||||
# 安装 Rust
|
# 安装 Rust
|
||||||
- name: Install Rust stable
|
- name: Install Rust nightly
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@nightly
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
|
|
||||||
# 使用 Rust 缓存,加快安装速度
|
# 使用 Rust 缓存,加快安装速度
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
@ -64,39 +62,33 @@ jobs:
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
|
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
|
||||||
|
|
||||||
# 安装PNPM
|
- name: install frontend dependencies
|
||||||
- uses: pnpm/action-setup@v2
|
run: pnpm install # change this to npm or pnpm depending on which one you use
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
|
||||||
version: 7
|
|
||||||
run_install: false
|
|
||||||
|
|
||||||
# 获取PNPM缓存路径
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# 设置PNPM缓存
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
# 安装依赖
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
# 执行构建,以及推送 github release
|
|
||||||
- name: Install app dependencies and build it
|
|
||||||
run: pnpm tauri build
|
|
||||||
- uses: tauri-apps/tauri-action@v0
|
- uses: tauri-apps/tauri-action@v0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}'
|
tauriScript: pnpm
|
||||||
|
releaseId: ${{ needs.create-release.outputs.release_id }}
|
||||||
|
|
||||||
|
publish-release:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: [create-release, build-tauri]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: publish release
|
||||||
|
id: publish-release
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
env:
|
||||||
|
release_id: ${{ needs.create-release.outputs.release_id }}
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.repos.updateRelease({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
release_id: process.env.release_id,
|
||||||
|
draft: false,
|
||||||
|
prerelease: false
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user