Files
WeFlow/.github/workflows/release.yml
2026-01-20 22:40:21 +08:00

51 lines
1.1 KiB
YAML

name: Build and Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: windows-latest
steps:
- name: Check out git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Sync version with tag
shell: bash
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "Syncing package.json version to $VERSION"
npm version $VERSION --no-git-tag-version --allow-same-version
- name: Build Frontend & Type Check
run: |
npx tsc
npx vite build
- name: Inject Configuration
shell: bash
run: |
npm pkg set build.releaseInfo.releaseNotes="修复了一些已知问题"
- name: Package and Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx electron-builder --publish always