From 81cadf0fdf342bed1edff8a5a92fb7481ceef443 Mon Sep 17 00:00:00 2001 From: cunzaizhuyi <877824709@qq.com> Date: Sat, 14 Sep 2024 09:29:17 +0800 Subject: [PATCH] feat: add github actions --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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..b04b77c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Create Release + +on: + push: + tags: + - 'v*.*.*' # 监听以 v 开头的标签推送 + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: npm install # 安装依赖 + + - name: Build project + run: npm run build # 执行构建命令 + + - name: Create zip file + run: zip -r extension.zip ./extension/ # 压缩 ./extension/ 目录 + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref }} # 使用推送的标签作为 release 的标签 + files: extension.zip # 上传的文件 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token