Files
um-react/.gitea/workflows/build.yaml
2025-10-15 22:52:59 +09:00

67 lines
1.9 KiB
YAML

name: Build and Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
npm_config_registry: https://registry.npmmirror.com
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4.0.0
with:
standalone: true
run_install: |
- args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Build
run: pnpm build
- name: Pack Win64
run: |
python3 -m zipfile -c um-react.zip dist/.
./scripts/make-win64.sh
- name: Publish Artifact
uses: christopherhx/gitea-upload-artifact@v4
with:
name: site
path: dist/
- name: Create Release Package
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=${GITHUB_REF#refs/tags/v}
mkdir release/
python3 -m zipfile -c "release/um-react-${VERSION}.zip" dist/.
cp win64/dist/*.zip "release/um-react-win64-${VERSION}.zip"
- name: Create Draft Release
if: startsWith(github.ref, 'refs/tags/')
uses: akkuman/gitea-release-action@v1
with:
draft: true
files: |
release/um-react-*.zip
body: |
上个版本:[v0.0.0](https://git.um-react.app/um/um-react/releases/tag/v0.0.0)
## 🐛 修正
- 修正内容
## ✨ 新增
- 新增内容
## 🔧 维护
- 维护内容
- name: Prepare for deployment
run: |
cp um-react.zip dist/"release-${GITHUB_SHA}.zip"
cp win64/dist/*.zip dist/"release-${GITHUB_SHA}-win64.zip"
python3 -m zipfile -c um-react-site.zip dist/.
- name: Deploy
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_API_KEY: ${{ secrets.NETLIFY_API_KEY }}
run: ./scripts/deploy.sh