From 752e64f2599998663d5e1b13115b687cf615d256 Mon Sep 17 00:00:00 2001 From: zihluwang Date: Fri, 8 May 2026 08:23:35 +0800 Subject: [PATCH] ci: add ci process --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6d28d28 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: Upload Release Assets + +on: + release: + types: [created] # 仅当创建 Release 之后触发 + +jobs: + build-and-upload: + runs-on: ubuntu-latest + + # 必须授予权限以允许 Action 修改 Release + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Create archive + run: | + TAG_NAME=${{ github.event.release.tag_name }} + tar -czvf "website-dist-${TAG_NAME}.tar.gz" --exclude=".git*" --exclude=".github*" . + + - name: Upload Release Asset + uses: softprops/action-gh-release@v2 + with: + # 上传刚才生成的 tar.gz 文件 + files: dist-${{ github.event.release.tag_name }}.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file