-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
ci: group cloud, desktop, mobile in one release workflow #12802
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
base: canary
Are you sure you want to change the base?
Conversation
ea4a058
to
fb73f6f
Compare
WalkthroughThis set of changes restructures the project's GitHub Actions workflows for building, releasing, and deploying software. Several legacy workflows and actions are removed, and new modular workflows and composite actions are introduced for streamlined versioning, building, and deployment. Inputs and outputs are standardized, and manual approval is added for stable releases. Changes
Sequence Diagram(s)Release Workflow OverviewsequenceDiagram
participant Dev as Developer
participant GH as GitHub Actions
participant Prepare as Prepare Release Action
participant Cloud as Release Cloud Workflow
participant Desktop as Release Desktop Workflow
participant Mobile as Release Mobile Workflow
participant Manual as Manual Approval
Dev->>GH: Trigger release (tag push, schedule, or manual)
GH->>Prepare: Run prepare-release action
Prepare-->>GH: Outputs app-version, git-short-hash, build-type
alt Web/Cloud release
GH->>Cloud: Call release-cloud with build-type, app-version, git-short-hash
Cloud->>GH: Build images & deploy to cloud
end
alt Stable build-type
GH->>Manual: Request manual approval for Docker stable tag
Manual-->>GH: Approval granted
GH->>GH: Tag and push stable Docker image
end
alt Desktop release
GH->>Desktop: Call release-desktop with build-type, app-version, git-short-hash
Desktop->>GH: Build and release desktop app
end
alt Mobile release
GH->>Mobile: Call release-mobile with build-type, app-version, git-short-hash
Mobile->>GH: Build and release mobile app
end
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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: 3
🔭 Outside diff range comments (1)
.github/workflows/release.yml (1)
115-129
: 🛠️ Refactor suggestionMobile job conditional needs update
To include mobile in non-dispatch events (push/schedule) similar to cloud/desktop, update:- if: ${{ inputs.mobile }} + if: ${{ inputs.mobile || github.event_name != 'workflow_dispatch' }}
♻️ Duplicate comments (1)
.github/workflows/release-mobile.yml (1)
52-54
: Duplicate: Invalid runner label
Same as above:runs-on: ubuntu-24.04-arm
forbuild-android-web
is likely unsupported.
🧹 Nitpick comments (10)
.github/actions/setup-version/action.yml (2)
3-6
: Documentapp-version
input
Consider adding adescription
forapp-version
to explain accepted formats (e.g.,1.2.3
,1.2.3-canary.ab12
).
12-12
: Quote version argument
To prevent word-splitting for complex version strings, wrap the interpolation in quotes:run: ./scripts/set-version.sh "${{ inputs.app-version }}".github/workflows/build-images.yml (2)
6-14
: Add descriptions for inputs
Consider addingdescription
fields for each input to improve readability and self-documentation.
280-280
: Consistent expression formatting
The tags use${{inputs.build-type}}
without spaces. For readability and consistency, consider using${{ inputs.build-type }}
.Also applies to: 291-291
.github/workflows/release-cloud.yml (1)
6-14
: Add descriptions for inputs
Consider addingdescription
fields for each input to clarify their purpose..github/workflows/release-desktop.yml (1)
4-14
: Add descriptions for inputs
Consider addingdescription
fields for each input for better documentation..github/workflows/release.yml (2)
11-27
: Manual dispatch inputs default behaviour
mobile
defaults tofalse
, but your cloud/desktop jobs fall back to run on non-dispatch events. To keep mobile aligned with cloud/desktop for push/schedule triggers, consider:if: ${{ inputs.mobile || github.event_name != 'workflow_dispatch' }}
29-33
: Tighten workflow permissions
Grantingactions: write
is broad. If you only need to read workflows or trigger runs, consider downgrading toactions: read
to follow the principle of least privilege..github/workflows/release-mobile.yml (2)
23-25
: Inconsistent environment protection
build-ios-web
setsenvironment: ${{ inputs.build-type }}
, butbuild-android-web
omits it. If you rely on environment-level secrets or approval gates, align both jobs.
43-46
: Duplicate version env variables
BothSENTRY_RELEASE
andRELEASE_VERSION
are set to${{ inputs.app-version }}
. If one is redundant, remove it to reduce confusion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
.github/actions/deploy/action.yml
(0 hunks).github/actions/prepare-release/action.yml
(1 hunks).github/actions/setup-version/action.yml
(1 hunks).github/workflows/build-images.yml
(13 hunks).github/workflows/build-selfhost-image.yml
(0 hunks).github/workflows/build-test.yml
(0 hunks).github/workflows/deploy-automatically.yml
(0 hunks).github/workflows/deploy.yml
(0 hunks).github/workflows/helm-releaser.yml
(0 hunks).github/workflows/label-checker.yml
(0 hunks).github/workflows/pr-auto-assign.yml
(0 hunks).github/workflows/release-automatically.yml
(0 hunks).github/workflows/release-cloud.yml
(1 hunks).github/workflows/release-desktop.yml
(10 hunks).github/workflows/release-mobile.yml
(9 hunks).github/workflows/release.yml
(1 hunks).github/workflows/windows-signer.yml
(0 hunks)
💤 Files with no reviewable changes (10)
- .github/workflows/build-selfhost-image.yml
- .github/actions/deploy/action.yml
- .github/workflows/pr-auto-assign.yml
- .github/workflows/label-checker.yml
- .github/workflows/windows-signer.yml
- .github/workflows/release-automatically.yml
- .github/workflows/build-test.yml
- .github/workflows/deploy-automatically.yml
- .github/workflows/helm-releaser.yml
- .github/workflows/deploy.yml
🔇 Additional comments (19)
.github/actions/setup-version/action.yml (1)
3-6
: Require explicitapp-version
input
Requiringapp-version
makes the action interface clear and enforces upstream version determination..github/workflows/build-images.yml (5)
6-14
: Explicit build metadata inputs
The workflow now clearly definesbuild-type
,app-version
, andgit-short-hash
inputs, improving clarity and type safety.
25-25
: Environment declarations
All jobs correctly use${{ inputs.build-type }}
for theenvironment
field, aligning the run environments with the specified build type.Also applies to: 59-59, 92-92, 125-125
29-31
: Setup Version usage
Each job consistently invokes thesetup-version
action with the newapp-version
input.Also applies to: 63-65, 95-98, 139-142, 173-176, 267-269
40-40
: Injection ofBUILD_TYPE
TheBUILD_TYPE
environment variable is properly passed into each build step.Also applies to: 74-74, 107-107
44-44
:SENTRY_RELEASE
updated
SettingSENTRY_RELEASE
to${{ inputs.app-version }}
ensures Sentry releases are correctly tagged..github/workflows/release-cloud.yml (1)
6-14
: Define workflow_call inputs
Explicit inputsbuild-type
,app-version
, andgit-short-hash
enable reuse by higher-level release workflows..github/workflows/release-desktop.yml (4)
4-14
: Define reusable workflow inputs
Theworkflow_call
inputsbuild-type
,app-version
, andgit-short-hash
are now explicitly declared.
33-33
: Environment binding
Bothbefore-make
andmake-distribution
jobs correctly setenvironment: ${{ inputs.build-type }}
, aligning environments with the build type.Also applies to: 81-81
51-52
: Version environment variables
SettingSENTRY_RELEASE
andRELEASE_VERSION
to${{ inputs.app-version }}
ensures consistent version tagging across Sentry and release artifacts.Also applies to: 90-90
37-40
: Setup Version invocation
Each job consistently invokessetup-version
with the newapp-version
input.Also applies to: 95-98, 221-222
.github/actions/prepare-release/action.yml (2)
1-2
: Action metadata
Thename
anddescription
are clear and concise.
3-12
: Output declarations
DefiningAPP_VERSION
,GIT_SHORT_HASH
, andBUILD_TYPE
as action outputs aligns with centralized release metadata..github/workflows/release.yml (5)
1-7
: Consider stable tag trigger
Currently the workflow only listens for canary tag pushes (vX.Y.Z-canary*
). If you intend to automate stable releases on standard version tags (vX.Y.Z
), include a pattern like:push: tags: - 'v[0-9]+.[0-9]+.[0-9]+' - 'v[0-9]+.[0-9]+.[0-9]+-canary.*'
35-47
: Prepare job structured well
Centralizing version and build-type logic into.github/actions/prepare-release
improves maintainability and consistency.
48-62
: Cloud job conditional correct
Usingif: ${{ inputs.web || github.event_name != 'workflow_dispatch' }}
ensures both manual and automated releases.
63-99
: Release-image sequence is clear
Manual approval gated onBUILD_TYPE == 'stable'
, followed by Docker login, Buildx, tagging, and push steps align with best practices.
100-114
: Desktop job invocation is solid
Leveraging the reusable workflow.github/workflows/release-desktop.yml
with explicit inputs maintains your DRY principle..github/workflows/release-mobile.yml (1)
27-30
: Verifysetup-version
input
You now passapp-version
to.github/actions/setup-version
. Confirm that the composite action’s signature matches this change to avoid breaking existing logic.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## canary #12802 +/- ##
========================================
Coverage 55.61% 55.62%
========================================
Files 2653 2653
Lines 125665 125665
Branches 19890 19891 +1
========================================
+ Hits 69893 69896 +3
+ Misses 54019 53459 -560
- Partials 1753 2310 +557
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fb73f6f
to
b709c61
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: 2
🧹 Nitpick comments (4)
.github/actions/prepare-release/action.yml (1)
37-39
: Remove or scope debugecho
statements
The unqualifiedecho $APP_VERSION
,echo $GIT_SHORT_HASH
, andecho $BUILD_TYPE
clutter logs. Remove them or prefix with a debug marker to distinguish from essential output..github/workflows/release-desktop.yml (1)
459-461
: Pass build metadata to the release script
Thegenerate-release-yml.mjs
step only receivesRELEASE_VERSION
. It likely needsBUILD_TYPE
andGIT_SHORT_HASH
as well to tag prereleases correctly. Add them underenv:
..github/workflows/release-mobile.yml (2)
53-54
: Add environment to Android build job
Unlikebuild-ios-web
, thebuild-android-web
job lacks anenvironment:
field. For consistency and to leverage environment protections/secrets, addenvironment: ${{ inputs.build-type }}
afterruns-on
.
81-82
: Align runner selection with build-type
The iOS job’sruns-on
usesgithub.ref_name
to detect canary, but you now haveinputs.build-type
. Replacegithub.ref_name == 'canary'
withinputs.build-type == 'canary'
for clarity and correctness.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
.github/actions/deploy/action.yml
(0 hunks).github/actions/prepare-release/action.yml
(1 hunks).github/actions/setup-version/action.yml
(1 hunks).github/workflows/build-images.yml
(13 hunks).github/workflows/build-selfhost-image.yml
(0 hunks).github/workflows/build-test.yml
(0 hunks).github/workflows/deploy-automatically.yml
(0 hunks).github/workflows/deploy.yml
(0 hunks).github/workflows/helm-releaser.yml
(0 hunks).github/workflows/label-checker.yml
(0 hunks).github/workflows/pr-auto-assign.yml
(0 hunks).github/workflows/release-automatically.yml
(0 hunks).github/workflows/release-cloud.yml
(1 hunks).github/workflows/release-desktop.yml
(10 hunks).github/workflows/release-mobile.yml
(8 hunks).github/workflows/release.yml
(1 hunks).github/workflows/windows-signer.yml
(0 hunks)
💤 Files with no reviewable changes (10)
- .github/workflows/build-selfhost-image.yml
- .github/workflows/label-checker.yml
- .github/workflows/release-automatically.yml
- .github/actions/deploy/action.yml
- .github/workflows/build-test.yml
- .github/workflows/deploy-automatically.yml
- .github/workflows/windows-signer.yml
- .github/workflows/deploy.yml
- .github/workflows/pr-auto-assign.yml
- .github/workflows/helm-releaser.yml
🚧 Files skipped from review as they are similar to previous changes (4)
- .github/actions/setup-version/action.yml
- .github/workflows/release-cloud.yml
- .github/workflows/release.yml
- .github/workflows/build-images.yml
⏰ Context from checks skipped due to timeout of 90000ms (50)
- GitHub Check: y-octo binding test on aarch64-pc-windows-msvc
- GitHub Check: y-octo binding test on aarch64-apple-darwin
- GitHub Check: y-octo binding test on x86_64-apple-darwin
- GitHub Check: y-octo binding test on x86_64-pc-windows-msvc
- GitHub Check: loom thread test
- GitHub Check: E2E BlockSuite Cross Browser Test (1, firefox)
- GitHub Check: Run native tests
- GitHub Check: E2E BlockSuite Cross Browser Test (1, webkit)
- GitHub Check: E2E BlockSuite Cross Browser Test (1, chromium)
- GitHub Check: E2E BlockSuite Cross Browser Test (2, chromium)
- GitHub Check: E2E BlockSuite Cross Browser Test (2, firefox)
- GitHub Check: fuzzing
- GitHub Check: E2E BlockSuite Cross Browser Test (2, webkit)
- GitHub Check: Build @affine/electron renderer
- GitHub Check: E2E Test (5)
- GitHub Check: E2E Test (10)
- GitHub Check: E2E Test (7)
- GitHub Check: E2E Test (8)
- GitHub Check: E2E BlockSuite Test (9)
- GitHub Check: E2E Test (3)
- GitHub Check: E2E Test (6)
- GitHub Check: E2E Test (9)
- GitHub Check: E2E Test (1)
- GitHub Check: E2E Test (2)
- GitHub Check: E2E BlockSuite Test (10)
- GitHub Check: E2E BlockSuite Test (8)
- GitHub Check: E2E Test (4)
- GitHub Check: Build Server native
- GitHub Check: E2E BlockSuite Test (4)
- GitHub Check: E2E BlockSuite Test (3)
- GitHub Check: E2E BlockSuite Test (5)
- GitHub Check: Build AFFiNE native (x86_64-pc-windows-msvc)
- GitHub Check: E2E BlockSuite Test (7)
- GitHub Check: Analyze (typescript, blocksuite)
- GitHub Check: E2E BlockSuite Test (6)
- GitHub Check: E2E BlockSuite Test (2)
- GitHub Check: Build AFFiNE native (aarch64-apple-darwin)
- GitHub Check: E2E Mobile Test (2)
- GitHub Check: E2E Mobile Test (1)
- GitHub Check: E2E BlockSuite Test (1)
- GitHub Check: E2E Mobile Test (5)
- GitHub Check: E2E Mobile Test (4)
- GitHub Check: E2E Mobile Test (3)
- GitHub Check: Build AFFiNE native (x86_64-apple-darwin)
- GitHub Check: Analyze (javascript, affine)
- GitHub Check: Build AFFiNE native (aarch64-pc-windows-msvc)
- GitHub Check: Analyze (typescript, affine)
- GitHub Check: Analyze (javascript, blocksuite)
- GitHub Check: Typecheck
- GitHub Check: Lint
b709c61
to
91e3294
Compare
91e3294
to
ff5e257
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: 0
♻️ Duplicate comments (1)
.github/workflows/release-mobile.yml (1)
178-178
: Fix GCloud auth condition for non-canary builds
Updating the auth step toif: env.BUILD_TYPE != 'canary'
restores credentials for both beta and stable releases as intended.
🧹 Nitpick comments (2)
.github/workflows/release-mobile.yml (2)
6-14
: Consider adding input descriptions and validations
The newworkflow_call
inputs (app-version
,git-short-hash
,build-type
) are clear but could benefit fromdescription
fields for maintainability and user guidance. If possible, enforce or document allowedbuild-type
values (e.g.canary
,beta
,stable
).
16-20
: DefineAPP_VERSION
globally to reduce repetition
You consistently referenceinputs.app-version
in multiple jobs—consider adding a globalAPP_VERSION: ${{ inputs.app-version }}
underenv:
so downstream steps can useenv.APP_VERSION
instead of repeating the input expression.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
.github/actions/deploy/action.yml
(0 hunks).github/actions/prepare-release/action.yml
(1 hunks).github/actions/setup-version/action.yml
(1 hunks).github/workflows/build-images.yml
(13 hunks).github/workflows/build-selfhost-image.yml
(0 hunks).github/workflows/build-test.yml
(0 hunks).github/workflows/deploy-automatically.yml
(0 hunks).github/workflows/deploy.yml
(0 hunks).github/workflows/helm-releaser.yml
(0 hunks).github/workflows/label-checker.yml
(0 hunks).github/workflows/pr-auto-assign.yml
(0 hunks).github/workflows/release-automatically.yml
(0 hunks).github/workflows/release-cloud.yml
(1 hunks).github/workflows/release-desktop.yml
(10 hunks).github/workflows/release-mobile.yml
(8 hunks).github/workflows/release.yml
(1 hunks)
💤 Files with no reviewable changes (9)
- .github/actions/deploy/action.yml
- .github/workflows/build-selfhost-image.yml
- .github/workflows/pr-auto-assign.yml
- .github/workflows/label-checker.yml
- .github/workflows/build-test.yml
- .github/workflows/deploy-automatically.yml
- .github/workflows/release-automatically.yml
- .github/workflows/helm-releaser.yml
- .github/workflows/deploy.yml
🚧 Files skipped from review as they are similar to previous changes (6)
- .github/actions/setup-version/action.yml
- .github/workflows/release-cloud.yml
- .github/actions/prepare-release/action.yml
- .github/workflows/build-images.yml
- .github/workflows/release.yml
- .github/workflows/release-desktop.yml
🔇 Additional comments (11)
.github/workflows/release-mobile.yml (11)
22-25
: Validate GitHub Environment names
Binding thebuild-ios-web
job withenvironment: ${{ inputs.build-type }}
requires matching GitHub Environment resources (e.g.,canary
,beta
,stable
). Please verify these environments exist to avoid runtime errors.
29-31
: Leverage explicit version input for iOS web build
Good update—setup-version
now correctly consumes the passedapp-version
input, aligning this job with the new modular versioning approach.
44-45
: Inject release metadata into iOS build environment
Setting bothSENTRY_RELEASE
andRELEASE_VERSION
frominputs.app-version
ensures external tooling (Sentry, logs, etc.) use the correct semantic version. Nice consistency.
53-54
: Ensure runner compatibility for Android web build
Switching toubuntu-latest
helps keep the image up to date, but please confirm all Android SDK dependencies and build tools are available in the latest runner.
58-60
: Propagate version input to Android web build
Thesetup-version
invocation now correctly usesinputs.app-version
on Android—this mirrors the iOS web build and maintains parity across platforms.
73-73
: Unify Sentry release tag for Android build
ApplyingSENTRY_RELEASE: ${{ inputs.app-version }}
here matches the iOS configuration and keeps error tracking consistent.
120-120
: Restrict Testflight to beta builds
The conditionif: env.BUILD_TYPE == 'beta'
correctly gates Testflight uploads to beta releases only.
143-146
: Align Android release version setup
Good use ofinputs.app-version
in the Android job’ssetup-version
step—this keeps versioning consistent with the web build and other platforms.
192-192
: Limit Play Store bump to non-canary builds
Theif: env.BUILD_TYPE != 'canary'
check prevents version bumps on preview releases, which is the desired behavior.
204-204
: Inject version name into Android packaging
DefiningVERSION_NAME: ${{ inputs.app-version }}
ensures the Android build artifacts carry the correct version string.
207-211
: Parameterize Google Play release uploads
Gatingupload-google-play
onBUILD_TYPE != 'canary'
and usingreleaseName: ${{ inputs.app-version }}
keeps internal track releases consistent and avoids publishing preview builds.
Summary by CodeRabbit
New Features
Refactor
Chores