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