From 724d0d10e013327e8f924bc9e4babc0e99b4f452 Mon Sep 17 00:00:00 2001 From: hi2hi Date: Mon, 9 Dec 2024 10:09:02 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=BB=A5=E4=BD=BF=E7=94=A8=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E8=AE=BE=E7=BD=AE=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E7=AE=80=E5=8C=96=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99575c3..ef5f7cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,15 +30,15 @@ jobs: - name: Get version from package.json id: get_version - run: echo "::set-output name=version::$(node -p "require('./package.json').version")" + run: echo "version=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV - name: Determine version id: determine_version run: | if [ "${{ github.event.inputs.version }}" ]; then - echo "::set-output name=version::${{ github.event.inputs.version }}" + echo "version=${{ github.event.inputs.version }}" >> $GITHUB_ENV else - echo "::set-output name=version::${{ steps.get_version.outputs.version }}" + echo "version=${{ steps.get_version.outputs.version }}" >> $GITHUB_ENV fi - name: Create Release @@ -47,16 +47,16 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ steps.determine_version.outputs.version }} - release_name: Release v${{ steps.determine_version.outputs.version }} + tag_name: v${{ env.version }} + release_name: Release v${{ env.version }} draft: false prerelease: false - name: 构建v0版本 - 完整引用版本 run: npm run build - - name: 打包v0-${{ steps.determine_version.outputs.version }}-all.zip - run: zip -r v0-${{ steps.determine_version.outputs.version }}-all.zip dist + - name: 打包v0-${{ env.version }}-all.zip + run: zip -r v0-${{ env.version }}-all.zip dist - name: 构建v0版本 - JSDeliver引用版本 env: @@ -65,8 +65,8 @@ jobs: VITE_CDN_LIB_TYPE: 'jsdelivr' run: npm run build - - name: 打包v0-${{ steps.determine_version.outputs.version }}-cdn-jsdelivr.zip - run: zip -r v0-${{ steps.determine_version.outputs.version }}-cdn-jsdelivr.zip dist + - name: 打包v0-${{ env.version }}-cdn-jsdelivr.zip + run: zip -r v0-${{ env.version }}-cdn-jsdelivr.zip dist - name: 构建v0版本 - loli(CDNJS)引用版本 env: @@ -75,8 +75,8 @@ jobs: VITE_CDN_LIB_TYPE: 'loli' run: npm run build - - name: 打包v0-${{ steps.determine_version.outputs.version }}-cdn-loli.zip - run: zip -r v0-${{ steps.determine_version.outputs.version }}-cdn-loli.zip dist + - name: 打包v0-${{ env.version }}-cdn-loli.zip + run: zip -r v0-${{ env.version }}-cdn-loli.zip dist - name: 构建哪吒v1内置版本 env: @@ -89,34 +89,34 @@ jobs: - name: 打包dist.zip run: zip -r dist.zip dist - - name: Upload v0-${{ steps.determine_version.outputs.version }}-all.zip + - name: Upload v0-${{ env.version }}-all.zip uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./v0-${{ steps.determine_version.outputs.version }}-all.zip - asset_name: v0-${{ steps.determine_version.outputs.version }}-all.zip + asset_path: ./v0-${{ env.version }}-all.zip + asset_name: v0-${{ env.version }}-all.zip asset_content_type: application/zip - - name: Upload v0-${{ steps.determine_version.outputs.version }}-cdn-jsdelivr.zip + - name: Upload v0-${{ env.version }}-cdn-jsdelivr.zip uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./v0-${{ steps.determine_version.outputs.version }}-cdn-jsdelivr.zip - asset_name: v0-${{ steps.determine_version.outputs.version }}-cdn-jsdelivr.zip + asset_path: ./v0-${{ env.version }}-cdn-jsdelivr.zip + asset_name: v0-${{ env.version }}-cdn-jsdelivr.zip asset_content_type: application/zip - - name: Upload v0-${{ steps.determine_version.outputs.version }}-cdn-loli.zip + - name: Upload v0-${{ env.version }}-cdn-loli.zip uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./v0-${{ steps.determine_version.outputs.version }}-cdn-loli.zip - asset_name: v0-${{ steps.determine_version.outputs.version }}-cdn-loli.zip + asset_path: ./v0-${{ env.version }}-cdn-loli.zip + asset_name: v0-${{ env.version }}-cdn-loli.zip asset_content_type: application/zip - name: Upload dist.zip @@ -135,16 +135,16 @@ jobs: git log -1 > changes.txt # 获取现有的发布说明 - gh release view v${{ steps.determine_version.outputs.version }} --json body -q .body > body.txt + gh release view v${{ env.version }} --json body -q .body > body.txt # 将变更内容添加到发布说明中 echo -e "### 本次发布\n" >> body.txt cat changes.txt >> body.txt # 添加其他发布说明 - echo -e "\n哪吒V1请下载dist.zip\n哪吒V0请下载v0-${{ steps.determine_version.outputs.version }}-(all|cdn-jsdelivr|cdn-loli).zip\n`all`是全量包,`cdn-jsdelivr`是jsdelivr引用版,`cdn-loli`是cdnjs引用版\nv0版本构建物通过修改`./config.js`指定`nezhaVersion`版本为`v1`可以匹配哪吒v1接口" >> body.txt + echo -e "\n哪吒V1请下载dist.zip\n哪吒V0请下载v0-${{ env.version }}-(all|cdn-jsdelivr|cdn-loli).zip\n`all`是全量包,`cdn-jsdelivr`是jsdelivr引用版,`cdn-loli`是cdnjs引用版\nv0版本构建物通过修改`./config.js`指定`nezhaVersion`版本为`v1`可以匹配哪吒v1接口" >> body.txt # 更新发布说明 - gh release edit v${{ steps.determine_version.outputs.version }} --notes-file body.txt + gh release edit v${{ env.version }} --notes-file body.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}