From 1f0965c1f7f8a47cf9268a463fb0b49ba44337c9 Mon Sep 17 00:00:00 2001 From: Yule Date: Tue, 4 Aug 2026 15:28:48 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=96=B0=E5=A2=9E=20build(=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E4=BA=A7=E7=89=A9)=20=E4=B8=8E=20release(=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E8=B5=84=E4=BA=A7)=20=E4=B8=A4=E4=B8=AA=20GitHub=20Ac?= =?UTF-8?q?tions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6f92750 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build & Upload Artifacts + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 11 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: web/pnpm-lock.yaml + + - name: Install dependencies + run: pnpm -C web install --frozen-lockfile + + - name: Build WebUI + run: pnpm -C web build + + - name: Pack module (preplace / template) + run: bash dev/cd.sh + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: fontmm-build + path: dist/*.zip + retention-days: 14 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0be1a99 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + release: + types: [published] + +jobs: + build-and-release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 11 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: web/pnpm-lock.yaml + + - name: Install dependencies + run: pnpm -C web install --frozen-lockfile + + - name: Build WebUI + run: pnpm -C web build + + - name: Pack module (preplace / template) + run: bash dev/cd.sh + + - name: Upload release assets + uses: softprops/action-gh-release@v2 + with: + files: dist/*.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}