From 1c3cab6cd7f716b342ef23956a612e908b86495d Mon Sep 17 00:00:00 2001 From: evan Date: Tue, 14 Apr 2026 20:09:14 +0800 Subject: [PATCH] ci: add Gitea Actions workflow for build, test, and release - lint, typecheck, build on every push/PR - create release with static export zip on version tags --- .gitea/workflows/ci.yml | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..06cd11b --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,64 @@ +name: Build & Release + +on: + push: + branches: [main] + tags: ["v*"] + pull_request: + branches: [main] + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Typecheck + run: npm run typecheck + + - name: Build + run: npm run build + + - name: Upload build artifact + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 + with: + name: resume-static + path: out/ + + release: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: resume-static + path: out/ + + - name: Create release zip + run: | + cd out && zip -r ../resume-${GITHUB_REF_NAME}.zip . + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + files: resume-${GITHUB_REF_NAME}.zip + generate_release_notes: true + fail_on_unmatched_files: true