ADFA-3989: Add weekly release automation workflow#1290
Conversation
📝 Walkthrough
WalkthroughAdds a new manual GitHub Actions workflow that computes CalVer versions, validates Jira, builds and stages plugin-api artifacts, downloads APKs from Firebase for V7/V8, creates an idempotent GitHub Release, uploads APKs to Cloudflare R2, and finalizes Jira and repository variables. ChangesWeekly Release Workflow
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/weekly-release.yml:
- Around line 138-172: The job should use the prepared version from
needs.prepare.outputs.version instead of loosely matching displayVersion by
prefix; add an env var (e.g. VERSION from needs.prepare.outputs.version) and
change the MATCH_JSON jq filter (currently using DISPLAY_VERSION_PREFIX and
BUILD_TYPE_TAG on LIST_JSON) to require (.displayVersion // "") == ($prefix +
$version) and still check releaseNotes contains $tag so only the exact prepared
release is selected; update references to MATCH_JSON and LIST_URL logic to use
the new VERSION variable when computing the expected displayVersion.
- Around line 28-34: The CalVer computation uses the calendar year specifier
`%y` and local time, which can misreport ISO week-based years around year
boundaries; update the "Compute CalVer version" step so VERSION and NEXT_VERSION
use the ISO week-based year `%g` and run date in UTC (add `-u`) when generating
both the current and +7 days values (update references to VERSION and
NEXT_VERSION accordingly).
- Around line 23-26: The workflow currently checks out a hardcoded ref ("main")
while using GITHUB_SHA for release targeting, causing mismatched build artifacts
and release tags; update each actions/checkout step (uses: actions/checkout@v4)
to check out the triggering ref by using ref: ${{ github.ref_name }} (or ${{
github.ref }} if needed), and change release target references from $GITHUB_SHA
to the checked-out commit by using the repository HEAD (e.g., $(git rev-parse
HEAD)) wherever the release CLI or --target is invoked; apply these same changes
to the other checkout/release occurrences mentioned (71-74, 100-103, 119-122,
224-227, 240-249) so builds and release tags reference the same commit.
- Line 16: Update each job's runner label from the generic "runs-on:
self-hosted" to explicitly pin OS and architecture by adding the linux and x64
labels (e.g., change the six occurrences of the literal "runs-on: self-hosted"
in the workflow to use an array that includes self-hosted, linux and x64) so the
jobs that call Linux-specific tools (date -d, sha256sum, flox, jq, aws, find)
only run on Linux x64 self-hosted runners.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4674137a-3e05-4067-b282-92f72757ac98
📒 Files selected for processing (2)
.github/workflows/weekly-release.ymlplugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/UIExtension.kt
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/weekly-release.yml (1)
86-106: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winExtract
.releasedirectory into a constant.The
.releasedirectory name appears in 7+ places across this job (lines 87, 88, 89, 90, 104, 105, 106). Define it once as a step-level or job-level env var (mirroring theSTAGING_DIRpattern used inpull-apk) so future changes don't require touching multiple lines.♻️ Proposed refactor
release-plugin-api: needs: prepare runs-on: self-hosted permissions: contents: write + env: + RELEASE_DIR: ./.release steps: - uses: actions/checkout@v4 with: ref: main - name: Build plugin-api jar run: | flox activate -d flox/base -- \ ./gradlew --console=plain --no-daemon :plugin-api:createPluginApiJar - name: Build plugin-builder jar run: | flox activate -d flox/base -- \ ./gradlew --console=plain --no-daemon -p plugin-api/plugin-builder :jar - name: Stage plugin-api release assets run: | - mkdir -p .release - cp plugin-api/build/libs/plugin-api-*.jar .release/plugin-api.jar - cp plugin-api/plugin-builder/build/libs/plugin-builder-*.jar .release/gradle-plugin.jar - ( cd .release && sha256sum plugin-api.jar gradle-plugin.jar > checksums.txt ) - ls -la .release + mkdir -p "$RELEASE_DIR" + cp plugin-api/build/libs/plugin-api-*.jar "$RELEASE_DIR/plugin-api.jar" + cp plugin-api/plugin-builder/build/libs/plugin-builder-*.jar "$RELEASE_DIR/gradle-plugin.jar" + ( cd "$RELEASE_DIR" && sha256sum plugin-api.jar gradle-plugin.jar > checksums.txt ) + ls -la "$RELEASE_DIR" - name: Replace plugin-api-latest release env: GH_TOKEN: ${{ github.token }} run: | if gh release view plugin-api-latest >/dev/null 2>&1; then gh release delete plugin-api-latest --cleanup-tag --yes fi gh release create plugin-api-latest \ --target "$GITHUB_SHA" \ --title "plugin-api (latest)" \ --notes "built from ${GITHUB_SHA} on $(date -u +'%Y-%m-%d %H:%M:%S UTC')" \ - .release/plugin-api.jar \ - .release/gradle-plugin.jar \ - .release/checksums.txt + "$RELEASE_DIR/plugin-api.jar" \ + "$RELEASE_DIR/gradle-plugin.jar" \ + "$RELEASE_DIR/checksums.txt"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/weekly-release.yml around lines 86 - 106, Define a single environment variable for the release directory (e.g., RELEASE_DIR='.release') at the job or step level (mirroring the STAGING_DIR pattern used in pull-apk) and replace every hardcoded ".release" occurrence in the step named "Replace plugin-api-latest release" and the preceding artifact preparation run block (mkdir -p .release, cp ..., cd .release, and the gh release create asset paths) with that variable (use $RELEASE_DIR or the workflow env syntax). Ensure the mkdir, cp, sha256sum and gh release create commands reference the new RELEASE_DIR variable consistently.
🧹 Nitpick comments (1)
.github/workflows/weekly-release.yml (1)
54-54: ⚡ Quick winUse
curl -fsSinstead of-fsfor better failure diagnostics.
-fssilences both progress and error output. When a Jira call fails (auth issue, network blip, 5xx), the step exits non-zero but the logs show nothing about the cause. Adding-Skeeps the silence on success but surfaces error messages on failure, which is a one-character change that meaningfully improves on-call debugging.♻️ Proposed change
- VERSION_DATA=$(curl -fs --user "$JIRA_EMAIL:$JIRA_API_TOKEN" \ + VERSION_DATA=$(curl -fsS --user "$JIRA_EMAIL:$JIRA_API_TOKEN" \ "https://appdevforall.atlassian.net/rest/api/3/project/ADFA/versions")- curl -fs -X PUT \ + curl -fsS -X PUT \ "https://appdevforall.atlassian.net/rest/api/3/version/$VERSION_ID" \Also applies to: 313-317
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/weekly-release.yml at line 54, The curl invocation that sets VERSION_DATA currently uses the -fs flags which suppress error output; update the curl calls (the one assigning VERSION_DATA and the other curl calls around lines 313-317) to use -fsS instead of -fs so errors are shown on failure while keeping success output silent—locate the command that begins with VERSION_DATA=$(curl -fs ...) and any other curl -fs usages and change the flags to -fsS.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In @.github/workflows/weekly-release.yml:
- Around line 86-106: Define a single environment variable for the release
directory (e.g., RELEASE_DIR='.release') at the job or step level (mirroring the
STAGING_DIR pattern used in pull-apk) and replace every hardcoded ".release"
occurrence in the step named "Replace plugin-api-latest release" and the
preceding artifact preparation run block (mkdir -p .release, cp ..., cd
.release, and the gh release create asset paths) with that variable (use
$RELEASE_DIR or the workflow env syntax). Ensure the mkdir, cp, sha256sum and gh
release create commands reference the new RELEASE_DIR variable consistently.
---
Nitpick comments:
In @.github/workflows/weekly-release.yml:
- Line 54: The curl invocation that sets VERSION_DATA currently uses the -fs
flags which suppress error output; update the curl calls (the one assigning
VERSION_DATA and the other curl calls around lines 313-317) to use -fsS instead
of -fs so errors are shown on failure while keeping success output silent—locate
the command that begins with VERSION_DATA=$(curl -fs ...) and any other curl -fs
usages and change the flags to -fsS.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cd4c11d9-3392-47a6-a563-8fbd05267a21
📒 Files selected for processing (1)
.github/workflows/weekly-release.yml
No description provided.