Skip to content

发布更新

发布更新 #4

Workflow file for this run

name: 发布更新
on:
workflow_dispatch:
jobs:
sync-latest-branch:
name: 同步 latest 分支
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git checkout -b latest origin/latest
git merge --ff-only origin/main
git push origin latest
release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- id: get-release
uses: actions/github-script@v7
with:
script: |
const [owner, repo] = process.env.REPO.split('/')
const { data } = await octokit.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
owner,
repo,
tag: process.env.REF,
headers: { 'X-GitHub-Api-Version': '2022-11-28' },
})
return data.id
env:
REF: ${{ github.action_ref }}
REPO: ${{ github.repository }}
- uses: dtolnay/rust-toolchain@stable
- uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- run: pnpm web:build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ steps.get-release.outputs.result }}