-
Notifications
You must be signed in to change notification settings - Fork 46
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
ci: add build-release
workflow and decouple Goreleaser
#1311
Conversation
Caution Review failedThe pull request is closed. WalkthroughA new GitHub Actions workflow named Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
✅ Deploy Preview for reearth-web canceled.
|
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
bf3946e
to
9122b2e
Compare
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.
Actionable comments posted: 3
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/build_release.yml
(1 hunks).github/workflows/build_server.yml
(0 hunks).github/workflows/ci.yml
(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/build_server.yml
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build_release.yml
30-30: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
34-34: 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)
38-38: the runner of "goreleaser/goreleaser-action@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
48-48: shellcheck reported issue in this script: SC2086:info:1:28: Double quote to prevent globbing and word splitting
(shellcheck)
48-48: shellcheck reported issue in this script: SC2046:warning:1:31: Quote this to prevent word splitting
(shellcheck)
48-48: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting
(shellcheck)
64-64: the runner of "dawidd6/action-download-artifact@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (3)
.github/workflows/build_release.yml (2)
1-20
: LGTM: Well-structured workflow inputs
The workflow is properly configured as a reusable workflow with all necessary inputs for versioning and identification.
68-77
: 🛠️ Refactor suggestion
Verify changelog file existence
The workflow attempts to use CHANGELOG_latest.md without verifying its existence after download.
Add a verification step:
- name: Verify changelog
if: ${{ inputs.new_tag != '' }}
run: |
if [ ! -f CHANGELOG_latest.md ]; then
echo "::error::CHANGELOG_latest.md not found"
exit 1
fi
.github/workflows/ci.yml (1)
86-96
: Verify job dependencies and deployment impact
The job dependencies look correct, but we should verify that this doesn't affect the deployment jobs.
The new build-release job is properly integrated into the workflow with correct dependencies and input passing.
✅ Verification successful
Build-release job integration verified and safe
The verification confirms that the new build-release job does not interfere with the existing deployment flow:
deploy-web
depends only onbuild-web
deploy-server
depends only onbuild-server
- No other jobs depend on
build-server
except the ones we've seen
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if deployment jobs have any conditions that might be affected
rg -A 5 "deploy-(web|server):" .github/workflows/ci.yml
# Check for any other jobs that might depend on build-server
ast-grep --pattern 'needs:.*build-server.*'
Length of output: 331
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: ~> v2 | ||
args: release --clean ${{ inputs.new_tag == '' && '--snapshot' || '' }} | ||
workdir: server | ||
env: | ||
GORELEASER_CURRENT_TAG: ${{ inputs.new_tag == '' && '0.0.0' || inputs.new_tag }} | ||
- name: Rename artifacts |
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.
Update GitHub Actions to their latest versions
Several actions are using outdated versions which may have security fixes or improvements in newer versions.
Apply these version updates:
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- uses: actions/setup-go@v4
+ uses: actions/setup-go@v5
- uses: goreleaser/goreleaser-action@v4
+ uses: goreleaser/goreleaser-action@v5
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: ~> v2 | |
args: release --clean ${{ inputs.new_tag == '' && '--snapshot' || '' }} | |
workdir: server | |
env: | |
GORELEASER_CURRENT_TAG: ${{ inputs.new_tag == '' && '0.0.0' || inputs.new_tag }} | |
- name: Rename artifacts | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21" | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: ~> v2 | |
args: release --clean ${{ inputs.new_tag == '' && '--snapshot' || '' }} | |
workdir: server | |
env: | |
GORELEASER_CURRENT_TAG: ${{ inputs.new_tag == '' && '0.0.0' || inputs.new_tag }} | |
- name: Rename artifacts |
🧰 Tools
🪛 actionlint (1.7.4)
30-30: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
34-34: 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)
38-38: the runner of "goreleaser/goreleaser-action@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
if: ${{ inputs.new_tag != '' }} | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: release.yml | ||
name: changelog-${{ inputs.new_tag }} | ||
- name: Create GitHub release |
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.
Update action-download-artifact to latest version
The action for downloading artifacts is using an outdated version.
Apply this version update:
- uses: dawidd6/action-download-artifact@v2
+ uses: dawidd6/action-download-artifact@v3
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if: ${{ inputs.new_tag != '' }} | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: release.yml | |
name: changelog-${{ inputs.new_tag }} | |
- name: Create GitHub release | |
if: ${{ inputs.new_tag != '' }} | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
workflow: release.yml | |
name: changelog-${{ inputs.new_tag }} | |
- name: Create GitHub release |
🧰 Tools
🪛 actionlint (1.7.4)
64-64: the runner of "dawidd6/action-download-artifact@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
if: ${{ inputs.name != '' }} | ||
run: for f in $ARTIFACTS; do mv $f $(echo $f | sed -E 's/_0\.0\.0-SNAPSHOT-[^_]*/_${{ inputs.name }}/'); done | ||
- name: List artifacts |
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.
Fix shell script quoting issues
The artifact renaming step has potential issues with word splitting and globbing.
Apply this fix:
- run: for f in $ARTIFACTS; do mv $f $(echo $f | sed -E 's/_0\.0\.0-SNAPSHOT-[^_]*/_${{ inputs.name }}/'); done
+ run: for f in "$ARTIFACTS"; do mv "$f" "$(echo "$f" | sed -E 's/_0\.0\.0-SNAPSHOT-[^_]*/_${{ inputs.name }}/')"; done
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if: ${{ inputs.name != '' }} | |
run: for f in $ARTIFACTS; do mv $f $(echo $f | sed -E 's/_0\.0\.0-SNAPSHOT-[^_]*/_${{ inputs.name }}/'); done | |
- name: List artifacts | |
if: ${{ inputs.name != '' }} | |
run: for f in "$ARTIFACTS"; do mv "$f" "$(echo "$f" | sed -E 's/_0\.0\.0-SNAPSHOT-[^_]*/_${{ inputs.name }}/')"; done | |
- name: List artifacts |
🧰 Tools
🪛 actionlint (1.7.4)
48-48: shellcheck reported issue in this script: SC2086:info:1:28: Double quote to prevent globbing and word splitting
(shellcheck)
48-48: shellcheck reported issue in this script: SC2046:warning:1:31: Quote this to prevent word splitting
(shellcheck)
48-48: shellcheck reported issue in this script: SC2086:info:1:38: Double quote to prevent globbing and word splitting
(shellcheck)
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com> Co-authored-by: rot1024 <aayhrot@gmail.com>
Overview
What I've done
What I haven't done
How I tested
Which point I want you to review particularly
Memo
Summary by CodeRabbit
New Features
build-release
job to the CI workflow, enhancing the release process.Bug Fixes
build-server
job to streamline the workflow.Chores
build-docker-image
job to improve execution logic.