From 2c16df733ac66dd89d08da932b0256e42407b30e Mon Sep 17 00:00:00 2001 From: JYC0413 Date: Mon, 27 Nov 2023 15:20:54 +0800 Subject: [PATCH] Create createRelease.yml --- .github/workflows/createRelease.yml | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/createRelease.yml diff --git a/.github/workflows/createRelease.yml b/.github/workflows/createRelease.yml new file mode 100644 index 0000000..79ec68f --- /dev/null +++ b/.github/workflows/createRelease.yml @@ -0,0 +1,42 @@ +name: Release +on: + push: + tags: + - 'v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: 16.x + - name: Install Dependencies + run: | + yarn + - name: Build Project + run: | + yarn build + yarn next export + - name: Zip Export + run: | + zip -r out.zip out + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./out.zip + asset_name: out.zip + asset_content_type: application/zip