From b3a4f903280883350b6d6ce4d7f0a741af1b92b7 Mon Sep 17 00:00:00 2001 From: sinspired Date: Sat, 21 Sep 2024 17:25:01 +0800 Subject: [PATCH] =?UTF-8?q?bugFix:=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=B5=8B=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_release.yml | 52 +++++++++++++++++++---------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 5962884..d97fcd2 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -6,29 +6,39 @@ on: - 'v*' jobs: - - build: + build-release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: 1.22 - + go-version: '1.22' + - name: Install dependencies - run: | - go mod tidy - + run: go mod tidy + - name: Build for Windows env: GOOS: windows GOARCH: amd64 - run: | - go build -o bestiptest.exe - + run: go build -o speedtest.exe + + - name: Get tag description + id: tag_description + run: | + TAG_DESCRIPTION=$(git tag -l --format='%(contents)' ${{ github.ref_name }}) + echo "tag_description=${TAG_DESCRIPTION}" >> $GITHUB_ENV + + - name: Get latest commit message + id: commit_message + run: | + COMMIT_MESSAGE=$(git log -1 --pretty=%B) + echo "commit_message=${COMMIT_MESSAGE}" >> $GITHUB_ENV + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -36,16 +46,22 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref_name }} - release_name: Release ${{ github.ref_name }} + release_name: "${{ github.ref_name }} ${{ env.tag_description }}" + # body: | + # ${{ github.action }} :${{ env.commit_message }} draft: false prerelease: false - + - name: Upload Windows 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: ./bestiptest.exe - asset_name: bestiptest.exe - asset_content_type: application/vnd.microsoft.portable-executable \ No newline at end of file + asset_path: ./speedtest.exe + asset_name: speedtest.exe + asset_content_type: application/vnd.microsoft.portable-executable + + + + \ No newline at end of file