-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix release-rc-pr workflow #1487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c566a96
67125ed
35928fa
2276e5e
c5c53b8
e9c172c
2c85096
82d2c63
abf9d86
503b50f
d8ecb73
afd633e
bed9d59
0c63f76
e885b0c
175e8bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: Create RC Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| release_version: | ||
| description: "Release version" | ||
| required: true | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: macos-latest | ||
| if: ${{ github.event_name == 'issue_comment' && contains(github.event.comment.body, '/release-rc') && startsWith(github.event.issue.title, 'Release') }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: main | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v4 | ||
| with: | ||
| go-version: "1.23.0" | ||
|
Comment on lines
+22
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Action Version Update: Set Up Go 🧰 Tools🪛 actionlint (1.7.4)21-21: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||
|
|
||
| - name: Add rocket emoji to comment | ||
| run: | | ||
| curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
| -d '{"body": "🚀 Starting the release process!"}' \ | ||
| "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" | ||
|
|
||
| - name: Parse release version from PR title | ||
| id: parse_release_version | ||
| env: | ||
| GITHUB_ISSUE_TITLE: ${{ github.event.issue.title }} | ||
| run: | | ||
| release_version=$(echo "$GITHUB_ISSUE_TITLE" | sed 's/ /\n/g' | tail -n 1) | ||
| echo "Release version: $release_version" | ||
| echo "release_version=$release_version" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build for macOS | ||
| working-directory: ./wren-launcher | ||
| run: | | ||
| mkdir -p dist | ||
| env GOARCH=amd64 GOOS=darwin CGO_ENABLED=1 go build -o dist/wren-launcher-darwin main.go | ||
| cd dist && chmod +x wren-launcher-darwin && tar zcvf wren-launcher-darwin.tar.gz wren-launcher-darwin | ||
|
|
||
| - name: Build for Linux | ||
| working-directory: ./wren-launcher | ||
| run: | | ||
| mkdir -p dist | ||
| env GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o dist/wren-launcher-linux main.go | ||
| cd dist && chmod +x wren-launcher-linux && tar zcvf wren-launcher-linux.tar.gz wren-launcher-linux | ||
|
|
||
| - name: Build for Windows | ||
| working-directory: ./wren-launcher | ||
| run: | | ||
| mkdir -p dist | ||
| env GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -o dist/wren-launcher-windows.exe main.go | ||
| cd dist && zip wren-launcher-windows.zip wren-launcher-windows.exe | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: | | ||
| ./wren-launcher/dist/wren-launcher-darwin.tar.gz | ||
| ./wren-launcher/dist/wren-launcher-linux.tar.gz | ||
| ./wren-launcher/dist/wren-launcher-windows.zip | ||
| tag_name: ${{ steps.parse_release_version.outputs.release_version }} | ||
| prerelease: true | ||
| generate_release_notes: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Comment with release link | ||
| run: | | ||
| release_url="https://github.com/${{ github.repository }}/releases/tag/${{ steps.parse_release_version.outputs.release_version }}" | ||
| curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
| -d "{\"body\": \"🚀 A new release has been created! [View Release](${release_url})\"}" \ | ||
| "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Upgrade Setup-Go Action Version
Similarly, the workflow uses
actions/setup-go@v4on line 20–22. Checking for a newer version (such asactions/setup-go@v5) is recommended to ensure optimal performance and take advantage of recent enhancements and security updates.🧰 Tools
🪛 actionlint (1.7.4)
21-21: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)