-
Notifications
You must be signed in to change notification settings - Fork 369
feat(repo): add workflow for automatic release #2271
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
Conversation
Warning Rate limit exceeded@xsahil03x has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 4 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughTwo new GitHub Actions workflows are introduced for automated releases: one triggers on commit messages to create GitHub releases, and another automates publishing Dart/Flutter packages to pub.dev using Melos. The Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub
participant GitHub Actions
participant Pub.dev
Developer->>GitHub: Push commit to master (with release message)
GitHub->>GitHub Actions: Trigger release_github workflow
GitHub Actions->>GitHub Actions: Extract version from commit message
GitHub Actions->>GitHub: Create GitHub release
Developer->>GitHub: Publish release or trigger workflow dispatch
GitHub->>GitHub Actions: Trigger release_pub workflow
GitHub Actions->>GitHub Actions: Set up Dart/Flutter and Melos
GitHub Actions->>GitHub Actions: Bootstrap workspace and lint
GitHub Actions->>Pub.dev: Publish packages using Melos
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 1
🧹 Nitpick comments (6)
.github/workflows/release_pub.yml (2)
24-25
: Pin Flutter version for reproducibility
It’s best practice to declare a specific Flutter version (or channel) when using thesubosito/flutter-action@v2
to avoid unexpected breaks as new Flutter versions roll out.- - name: 🐦 Install Flutter - uses: subosito/flutter-action@v2 + - name: 🐦 Install Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: "3.27.4" + channel: stable
36-36
: Add newline at end of file
YAML parsers expect a trailing newline.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 36-36: no new line character at the end of file
(new-line-at-end-of-file)
melos.yaml (2)
151-154
: Unify flag syntax for consistency
In bothlint:pub
andrelease:pub
scripts you’re using-c1
. For readability and alignment with other commands, prefer a space between flag and value (-c 1
).- run: melos exec -c1 --no-published --no-private --order-dependents -- "flutter pub publish -n" + run: melos exec -c 1 --no-published --no-private --order-dependents -- "flutter pub publish -n" - release:pub: - run: melos exec -c1 --no-published --no-private --order-dependents -- "flutter pub publish -f" + release:pub: + run: melos exec -c 1 --no-published --no-private --order-dependents -- "flutter pub publish -f"Also applies to: 206-208
208-208
: Add newline at end of file
YAML files should end with a newline to satisfy lint rules.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 208-208: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/release_github.yml (2)
15-16
: Align checkout action version
Inrelease_pub.yml
you’re usingactions/checkout@v4
. For consistency, consider upgrading this step toactions/checkout@v4
here as well.- - name: 📚 Checkout branch - uses: actions/checkout@v3 + - name: 📚 Checkout branch + uses: actions/checkout@v4
51-51
: Add newline at end of file
A trailing newline is required to pass YAML lint.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 51-51: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/release_github.yml
(1 hunks).github/workflows/release_pub.yml
(1 hunks)melos.yaml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/release_pub.yml
[error] 36-36: no new line character at the end of file
(new-line-at-end-of-file)
melos.yaml
[error] 208-208: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/release_github.yml
[error] 51-51: no new line character at the end of file
(new-line-at-end-of-file)
[error] 10-10: syntax error: mapping values are not allowed here
(syntax)
🪛 actionlint (1.7.7)
.github/workflows/release_github.yml
10-10: could not parse as YAML: yaml: line 10: mapping values are not allowed in this context
(syntax-check)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: stream_chat_localizations
- GitHub Check: stream_chat_flutter
🔇 Additional comments (1)
.github/workflows/release_github.yml (1)
5-6
: Verify default branch name
This workflow only runs on pushes tomaster
. Please confirm that the repository’s default branch is indeedmaster
; otherwise update thebranches
filter to match (main
or another).
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: 0
♻️ Duplicate comments (1)
.github/workflows/release_github.yml (1)
10-10
:⚠️ Potential issueFix
if
expression syntax
GitHub Actions requires${{ }}
around conditional expressions. Without it, the job will fail to parse.
Apply this diff:- if: {{ startsWith(github.event.head_commit.message, 'chore(repo): release') }} + if: ${{ startsWith(github.event.head_commit.message, 'chore(repo): release') }}🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 10-10: syntax error: expected ',' or '}', but got ''
(syntax)
🧹 Nitpick comments (2)
melos.yaml (1)
208-208
: Add newline at end of file
YAMLLint flagged a missing end-of-file newline. Please append a blank line after the last line to satisfy the linter.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 208-208: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/release_github.yml (1)
51-51
: Add newline at end of file
YAMLLint reports no newline at end-of-file. Please add a terminating blank line to ensure valid YAML.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 51-51: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/release_github.yml
(1 hunks)melos.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/release_github.yml
9-9: could not parse as YAML: yaml: line 9: did not find expected ',' or '}'
(syntax-check)
🪛 YAMLlint (1.37.1)
.github/workflows/release_github.yml
[error] 51-51: no new line character at the end of file
(new-line-at-end-of-file)
[error] 10-10: syntax error: expected ',' or '}', but got ''
(syntax)
melos.yaml
[error] 208-208: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (2)
melos.yaml (2)
151-153
: Approve updatedlint:pub
script
The simplifiedlint:pub
task, using-n
for dry-run and the refined flags (--no-published
,--no-private
,--order-dependents
) aligns with Melos best practices and reduces unnecessary concurrent jobs.
206-208
: Approve newrelease:pub
script
Therelease:pub
script correctly mirrorslint:pub
but uses-f
for force publishing. This complements your GitHub Actions workflow and cleanly automates package publication to pub.dev.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 208-208: no new line character at the end of file
(new-line-at-end-of-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: 1
🧹 Nitpick comments (3)
.github/workflows/release_github.yml (3)
29-31
: Improve regex robustness for version extractionThe current regex will match the first SemVer-like substring anywhere in the message, which may lead to false positives in complex commit messages. Consider anchoring or adding word boundaries:
- version_regex='[vV][0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.\-]+)?' + version_regex='\b[vV][0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?\b'This ensures you match a standalone tag exactly.
47-53
: Consider pinning or upgradingaction-gh-release
versionThe workflow uses
softprops/action-gh-release@v1
. Verify if a newer major version (e.g.,v2
) exists for improved features or security patches. Alternatively, pin to a specific minor release (e.g.,v1.5.0
) or a full commit SHA to lock behavior.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 53-53: no new line character at the end of file
(new-line-at-end-of-file)
53-53
: Add a newline at end of fileYAML linters often require a trailing newline. Please append an empty line after the last entry to satisfy standard lint rules.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 53-53: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/release_github.yml
(1 hunks)melos.yaml
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- melos.yaml
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/release_github.yml
10-10: could not parse as YAML: yaml: line 10: mapping values are not allowed in this context
(syntax-check)
🪛 YAMLlint (1.37.1)
.github/workflows/release_github.yml
[error] 53-53: no new line character at the end of file
(new-line-at-end-of-file)
[error] 10-10: syntax error: mapping values are not allowed here
(syntax)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: stream_chat_flutter
- GitHub Check: stream_chat_localizations
🔇 Additional comments (5)
.github/workflows/release_github.yml (5)
3-6
: Verify branch filter aligns with repository defaultThis workflow triggers on pushes to
master
. Confirm your repo’s default branch is indeed namedmaster
and notmain
(or another). If the default branch differs, update this filter to avoid missing release events.
10-10
: Correct usage of${{ }}
for theif
conditionThe
if:
expression is properly wrapped in${{ }}
, ensuring it’s parsed and evaluated by GitHub Actions as intended.🧰 Tools
🪛 actionlint (1.7.7)
10-10: could not parse as YAML: yaml: line 10: mapping values are not allowed in this context
(syntax-check)
🪛 YAMLlint (1.37.1)
[error] 10-10: syntax error: mapping values are not allowed here
(syntax)
14-18
: Checkout action configured correctlyUsing
actions/checkout@v4
withfetch-depth: 0
ensures full history is available for tag extraction and accurate release-note generation.
19-24
: Robust Bash setup for tag extractionIncluding
set -euo pipefail
at the top of the script makes it fail fast on errors, undefined variables, or pipeline failures—good practice for CI scripts.
25-28
: Proper retrieval and logging of commit messageCapturing the commit message in a variable and echoing it improves debuggability by making it clear exactly what text the regex is matching against.
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
♻️ Duplicate comments (1)
.github/workflows/release_github.yml (1)
42-43
: Fix error annotation syntaxGitHub Actions error annotations must have no spaces between the directive and
::
. Update both lines so errors are correctly surfaced in the UI:- echo "::error ::❌ No SemVer tag found in commit message." - echo "::error ::Expected something like: 'chore(repo): release v1.2.3[-beta]'" + echo "::error::❌ No SemVer tag found in commit message." + echo "::error::Expected something like: chore(repo): release v1.2.3[-beta]"
🧹 Nitpick comments (3)
.github/workflows/release_github.yml (3)
11-11
: Remove or explain commented-outif
conditionalThe commented-out
if:
line is dead code and could confuse readers. Either remove the commented filter entirely or re-enable/configure it if you intend to guard this job to only run on specific commit messages.
48-48
: Pinsoftprops/action-gh-release
to a fixed versionUsing a floating major tag (
@v1
) can introduce breaking changes unexpectedly. Pin to a specific minor/patch release to ensure reproducible workflows:- - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v1.3.0 # pin to the current stable patch🧰 Tools
🪛 actionlint (1.7.7)
48-48: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
54-54
: Ensure newline at end of fileAdd a newline at the end of this YAML file to satisfy linters and POSIX conventions.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 54-54: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/release_github.yml
(1 hunks)packages/stream_chat/pubspec.yaml
(1 hunks)packages/stream_chat_flutter/pubspec.yaml
(1 hunks)packages/stream_chat_flutter_core/pubspec.yaml
(1 hunks)packages/stream_chat_localizations/pubspec.yaml
(1 hunks)packages/stream_chat_persistence/pubspec.yaml
(1 hunks)
✅ Files skipped from review due to trivial changes (5)
- packages/stream_chat/pubspec.yaml
- packages/stream_chat_flutter/pubspec.yaml
- packages/stream_chat_persistence/pubspec.yaml
- packages/stream_chat_flutter_core/pubspec.yaml
- packages/stream_chat_localizations/pubspec.yaml
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/release_github.yml
48-48: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
.github/workflows/release_github.yml
[error] 54-54: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build (android)
- GitHub Check: test
- GitHub Check: analyze_legacy_versions
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2271 +/- ##
=======================================
Coverage 63.28% 63.28%
=======================================
Files 404 404
Lines 25269 25269
=======================================
Hits 15992 15992
Misses 9277 9277 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
11be847
to
8f60730
Compare
Summary by CodeRabbit