From 179bb54ca946b6b4ed92a470fbf039d824445eca Mon Sep 17 00:00:00 2001 From: ngseke Date: Wed, 22 Nov 2023 19:51:03 +0800 Subject: [PATCH] chore: create release workflow --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 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..d3d1767 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - uses: pnpm/action-setup@v2.2.2 + with: + version: 8.6.10 + + - uses: actions/setup-node@v2 + with: + node-version: '18' + + - name: Install Dependencies + run: pnpm i + + - name: Run Lints + run: pnpm run lint + + - name: Build + run: pnpm run build + + - name: Compress Dist Folder + run: zip -r build.zip dist + + - name: Get Tag Name + run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + + - name: Create Release + id: create_release + uses: ncipollo/release-action@v1.10.0 + with: + tag: ${{ github.ref }} + name: ${{ env.TAG }} + draft: true + omitDraftDuringUpdate: true + artifacts: build.zip