From 7dcfdb2e9a65a19fdc20229cd3f80d6e736c04d5 Mon Sep 17 00:00:00 2001 From: hobby Date: Wed, 19 Mar 2025 22:57:25 +0800 Subject: [PATCH 1/3] add new token --- .github/workflows/release.yml | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 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..f7d45c6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Create Release + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Archive dist directory + run: zip -r dist.zip dist + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + tag_name: v${{ github.run_number }} + release_name: Release v${{ github.run_number }} + body: | + Automated release for version v${{ github.run_number }}. + draft: false + prerelease: false + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist.zip + asset_name: dist.zip + asset_content_type: application/zip \ No newline at end of file From 413693924cf52f51f2f0e007d06b3acac0100548 Mon Sep 17 00:00:00 2001 From: hobby Date: Wed, 19 Mar 2025 23:00:08 +0800 Subject: [PATCH 2/3] change node 20 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7d45c6..4f61eff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '20' - name: Install dependencies run: npm install From cc100c781598e900027efa374e37a33bcfe23b73 Mon Sep 17 00:00:00 2001 From: hobby Date: Wed, 19 Mar 2025 23:03:42 +0800 Subject: [PATCH 3/3] fix workflow --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f61eff..79ba1d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: v${{ github.run_number }} release_name: Release v${{ github.run_number }} @@ -43,7 +43,7 @@ jobs: - name: Upload release asset uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./dist.zip