-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat: add auto publish workflow #1005
feat: add auto publish workflow #1005
Conversation
WalkthroughA new GitHub Actions workflow Changes
Suggested labels
Suggested reviewers
Possibly related PRs
Poem
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
CodeRabbit Configuration File (
|
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: 5
🧹 Nitpick comments (1)
.github/workflows/Release.yml (1)
1-55
: Consider environment-specific workflow configurationsFor a more robust release process, consider:
- Adding environment-specific configurations (e.g., different registries for staging/production)
- Implementing release notes generation
- Adding post-publish verification steps
Example implementation:
# .github/workflows/Release.yml env: RELEASE_ENV: ${{ startsWith(github.ref, 'refs/tags/v') && 'production' || 'staging' }} # Then use conditions like: if: env.RELEASE_ENV == 'production'Would you like me to provide a complete implementation of these improvements?
🧰 Tools
🪛 actionlint (1.7.4)
40-40: shellcheck reported issue in this script: SC1009:info:2:1: The mentioned syntax error was in this if expression
(shellcheck)
40-40: shellcheck reported issue in this script: SC1035:error:2:4: You need a space after the [[ and before the ]]
(shellcheck)
40-40: shellcheck reported issue in this script: SC1073:error:2:4: Couldn't parse this test expression. Fix to allow more checks
(shellcheck)
40-40: shellcheck reported issue in this script: SC1020:error:2:30: You need a space before the ]]
(shellcheck)
40-40: shellcheck reported issue in this script: SC1072:error:2:30: Missing space before ]. Fix any mentioned problems and try again
(shellcheck)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/Release.yml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/Release.yml
40-40: shellcheck reported issue in this script: SC1009:info:2:1: The mentioned syntax error was in this if expression
(shellcheck)
40-40: shellcheck reported issue in this script: SC1035:error:2:4: You need a space after the [[ and before the ]]
(shellcheck)
40-40: shellcheck reported issue in this script: SC1073:error:2:4: Couldn't parse this test expression. Fix to allow more checks
(shellcheck)
40-40: shellcheck reported issue in this script: SC1020:error:2:30: You need a space before the ]]
(shellcheck)
40-40: shellcheck reported issue in this script: SC1072:error:2:30: Missing space before ]. Fix any mentioned problems and try again
(shellcheck)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (1)
.github/workflows/Release.yml (1)
16-34
: LGTM! Well-configured setup stepsThe setup steps are using the latest action versions and properly configured caching for optimal performance.
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: 1
🧹 Nitpick comments (2)
.github/workflows/Release.yml (2)
40-45
: Configure artifact retention periodConsider setting a retention period for build logs to manage storage:
- name: Upload build logs uses: actions/upload-artifact@v4 with: name: build-alpha-log path: build-alpha.log + retention-days: 30
76-79
: Add error handling for npm publishConsider adding error handling and retries for the npm publish command:
- name: Publish package to npm - run: pnpm lerna publish from-package --dist-tag ${{steps.parse_tag.outputs.dist_tag}} --yes + run: | + n=0 + until [ $n -ge 3 ]; do + pnpm lerna publish from-package --dist-tag ${{steps.parse_tag.outputs.dist_tag}} --yes && break + n=$((n+1)) + echo "Retry $n of 3" + sleep 15 + done env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NPM_CONFIG_PROVENANCE: trueAlso added NPM provenance setting to enhance supply chain security.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/Release.yml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/Release.yml
48-48: shellcheck reported issue in this script: SC2086:info:3:28: Double quote to prevent globbing and word splitting
(shellcheck)
48-48: shellcheck reported issue in this script: SC2086:info:5:27: Double quote to prevent globbing and word splitting
(shellcheck)
48-48: shellcheck reported issue in this script: SC2086:info:7:25: Double quote to prevent globbing and word splitting
(shellcheck)
48-48: shellcheck reported issue in this script: SC2086:info:9:29: Double quote to prevent globbing and word splitting
(shellcheck)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (2)
.github/workflows/Release.yml (2)
16-34
: LGTM! Well-configured setup stepsThe setup is properly configured with latest action versions, explicit version pinning, and correct caching configuration.
8-14
: 🛠️ Refactor suggestionAdd concurrency control to prevent parallel releases
To prevent race conditions from multiple simultaneous releases, add concurrency control:
jobs: release: + concurrency: release-${{ github.ref }} if: github.repository == 'opentiny/tiny-engine' runs-on: ubuntu-latest permissions:
Likely invalid or redundant comment.
99c6540
to
ec512c1
Compare
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit