From 5314c83f9889043ad9aa5839a4ded4eca47c891e Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 30 Apr 2024 00:49:57 +0800 Subject: [PATCH 1/2] fix scripts error --- .github/workflows/publish-image.yml | 3 +-- .github/workflows/publish-release.yml | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 6db05d57c..41437c6b2 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -32,8 +32,7 @@ jobs: TargetVersion="" if [ "${{ github.event.release.tag_name }}" ] ; then TargetVersion=${{ github.event.release.tag_name }} - fi - then + else TargetVersion=$(echo "$GITHUB_REF" | sed 's/refs\/tags\///') fi echo "TargetVersion: $TargetVersion" diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 2c61c1ee5..27bcad275 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -32,15 +32,17 @@ jobs: - name: Extract Release Notes id: release_notes run: | - content=$(grep -m1 "##" -A 1000 ./CHANGELOG.md) - echo "::set-output name=content::$content" + content=$(grep -m1 "##" -A 1000 ./CHANGELOG.md) + version=$(echo "$GITHUB_REF" | sed 's/refs\/tags\///') + echo "::set-output name=content::$content" + echo "::set-output name=version::version" - name: Create Release uses: softprops/action-gh-release@v1 with: files: './src/Ray.BiliBiliTool.Console/bin/Publish/*.zip' token: ${{ secrets.GITHUB_TOKEN }} - name: "BiliBiliToolPro-V${{ github.event.inputs.version }}" + name: "BiliBiliToolPro-V${{ steps.release_notes.outputs.version }}" tag_name: ${{ github.event.inputs.version }} body: ${{ steps.release_notes.outputs.content }} discussion_category_name: Announcements From 32d724d91037526cff1f7c7e849eea0e884413db Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 30 Apr 2024 00:52:29 +0800 Subject: [PATCH 2/2] Update publish-release.yml --- .github/workflows/publish-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 27bcad275..a8fef3334 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -35,7 +35,7 @@ jobs: content=$(grep -m1 "##" -A 1000 ./CHANGELOG.md) version=$(echo "$GITHUB_REF" | sed 's/refs\/tags\///') echo "::set-output name=content::$content" - echo "::set-output name=version::version" + echo "::set-output name=version::$version" - name: Create Release uses: softprops/action-gh-release@v1