From 76eeae3b77a4786e4ae26a8005db388b9e7c6aac Mon Sep 17 00:00:00 2001 From: farion1231 Date: Wed, 6 Aug 2025 23:30:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20GitHub=20Actions=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9E=84=E5=BB=BA=E5=92=8C=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 支持跨平台自动构建(Windows、macOS、Linux) - 在创建 tag 时自动触发构建和发布 - 自动上传构建产物到 GitHub Releases - 添加跨平台构建脚本命令 --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9c1688c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build application + run: | + npm run build + npm run dist + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Release Assets + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + release/*.exe + release/*.dmg + release/*.AppImage + release/*.deb + release/*.rpm + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file