From e03b82fb44bb00568045b3259996fba72b02b9fa Mon Sep 17 00:00:00 2001 From: idranme Date: Mon, 2 Sep 2024 18:28:21 +0800 Subject: [PATCH] optimize: ci --- .github/workflows/publish.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6aa6089..f5bf152 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: 'publish' +name: Publish on: push: tags: @@ -8,31 +8,36 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - name: checkout + - name: Checkout uses: actions/checkout@v4 - - name: setup node + - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 - - name: install dependenies + - name: Install dependenies run: | export ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install - - name: build + - name: Build run: npm run build - - name: zip + - name: Compress run: | sudo apt install zip -y cd ./dist/ zip -r ../LLOneBot.zip ./* - - name: publish + - name: Extract version from tag + id: get-version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" + + - name: Release uses: ncipollo/release-action@v1 with: artifacts: 'LLOneBot.zip' draft: true token: ${{ secrets.RELEASE_TOKEN }} + name: LLOneBot v${{ steps.get-version.outputs.VERSION }}