-
-
Notifications
You must be signed in to change notification settings - Fork 4
chore(build): prepare for releases #78
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
Merged
wmontwe
merged 15 commits into
thunderbird:main
from
wmontwe:chore-build-prepare-for-releases
Jun 25, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c2171b3
chore(build): add Bom plugin
wmontwe 95fe4e9
chore(build): refine publishing plugins with version validation and d…
wmontwe 6d3c3b4
chore(build): add release and snapshot publishing GitHub workflows
wmontwe aced73d
chore(deps): bump AGP 8.13.2 -> 9.2.1
wmontwe 8930899
chore(deps): bump AndroidX Activity 1.10.1 -> 1.13.0
wmontwe f5a1061
chore(deps): bump dependency check plugin 0.53.0 -> 0.54.0
wmontwe c2ddef3
chore(deps): bump kotlinx serialization 1.10.0 -> 1.11.0
wmontwe 26aca0e
chore(deps): bump detekt compose plugin 0.5.8 -> 0.6.2
wmontwe 1b9e440
chore(build): add dokka plugin for documentation
wmontwe f27c1cb
chore(build): enable ABI compatibility check
wmontwe a69e5d9
chore(build): enable isolated Gradle projects and resolve failures
wmontwe ffa6ebf
chore(ci): ignore updates for Gradle in Dependabot config
wmontwe 888ef7a
chore(deps): bump detekt to 2.0.0-alpha.5
wmontwe 3f17729
chore(build): use logger for printing release tag in PrintReleaseTagTask
wmontwe b6396a3
chore(detekt): update rules configuration
wmontwe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,3 +24,5 @@ updates: | |
| commit-message: | ||
| prefix: chore | ||
| include: scope | ||
| ignore: | ||
| - dependency-name: "gradle" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| name: Publish - Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| component_path: | ||
| description: "Gradle path of the component to publish, e.g. :components:bom" | ||
| required: true | ||
| default: ":components:bom" | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: publish-release-${{ inputs.component_path }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| publish-release: | ||
| name: Publish release | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
|
|
||
| env: | ||
| COMPONENT_PATH: ${{ inputs.component_path }} | ||
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | ||
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_IN_MEMORY_KEY_ID }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }} | ||
|
|
||
| steps: | ||
| - name: Validate branch | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if [[ "${GITHUB_REF_NAME}" != "main" ]]; then | ||
| echo "Releases must be published from main. Current ref: ${GITHUB_REF_NAME}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Gradle environment | ||
| uses: ./.github/actions/setup-gradle | ||
|
|
||
| - name: Configure Git author | ||
| run: | | ||
| git config user.name "TMC Release Bot" | ||
| git config user.email "tmc-release-bot@thunderbird.net" | ||
|
|
||
| - name: Create release tag | ||
| id: release-tag | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| tag="$(./gradlew -q "${COMPONENT_PATH}:printReleaseTag")" | ||
|
|
||
| if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then | ||
| tag_commit="$(git rev-list -n 1 "${tag}")" | ||
| head_commit="$(git rev-parse HEAD)" | ||
|
|
||
| if [[ "${tag_commit}" != "${head_commit}" ]]; then | ||
| echo "Release tag ${tag} already exists but does not point at HEAD." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Release tag ${tag} already exists on HEAD." | ||
| echo "tag=${tag}" >> "${GITHUB_OUTPUT}" | ||
| exit 0 | ||
| fi | ||
|
|
||
| ./gradlew "${COMPONENT_PATH}:createReleaseTag" | ||
|
|
||
| if ! git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then | ||
| echo "Expected release tag ${tag} to be created." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "tag=${tag}" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Write release notes | ||
| run: ./gradlew "${COMPONENT_PATH}:writeReleaseNotes" -PreleaseNotesFile="${RUNNER_TEMP}/release-notes.md" | ||
|
|
||
| - name: Publish release | ||
| run: ./gradlew "${COMPONENT_PATH}:validateStableVersionForPublishing" "${COMPONENT_PATH}:publishAndReleaseToMavenCentral" | ||
|
|
||
| - name: Push release tag | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| tag="${{ steps.release-tag.outputs.tag }}" | ||
| if git ls-remote --exit-code --tags origin "refs/tags/${tag}" >/dev/null 2>&1; then | ||
| echo "Remote release tag ${tag} already exists." | ||
| exit 0 | ||
| fi | ||
|
|
||
| git push origin "refs/tags/${tag}" | ||
|
|
||
| - name: Create GitHub release | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| tag="${{ steps.release-tag.outputs.tag }}" | ||
| if gh release view "${tag}" >/dev/null 2>&1; then | ||
| echo "GitHub release ${tag} already exists." | ||
| exit 0 | ||
| fi | ||
|
|
||
| gh release create "${tag}" \ | ||
| --title "${tag}" \ | ||
| --target "${GITHUB_SHA}" \ | ||
| --verify-tag \ | ||
| --notes-file "${RUNNER_TEMP}/release-notes.md" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: Publish - Snapshot | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: publish-snapshot | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| publish-snapshot: | ||
| name: Publish snapshot | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
|
|
||
| env: | ||
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | ||
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_IN_MEMORY_KEY_ID }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }} | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| ref: main | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check snapshot marker | ||
| id: snapshot-marker | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| marker="snapshot/latest" | ||
| head_commit="$(git rev-parse HEAD)" | ||
|
|
||
| if git rev-parse -q --verify "refs/tags/${marker}" >/dev/null; then | ||
| marker_commit="$(git rev-list -n 1 "${marker}")" | ||
|
|
||
| if [[ "${marker_commit}" == "${head_commit}" ]]; then | ||
| echo "Snapshot marker ${marker} already points at HEAD. Nothing to publish." | ||
| echo "publish=false" >> "${GITHUB_OUTPUT}" | ||
| exit 0 | ||
| fi | ||
| fi | ||
|
|
||
| echo "publish=true" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Setup Gradle environment | ||
| if: steps.snapshot-marker.outputs.publish == 'true' | ||
| uses: ./.github/actions/setup-gradle | ||
|
|
||
| - name: Publish snapshot | ||
| if: steps.snapshot-marker.outputs.publish == 'true' | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| ./gradlew validateSnapshotVersionForPublishing | ||
| ./gradlew publishToMavenCentral | ||
|
|
||
| - name: Update snapshot marker | ||
| if: steps.snapshot-marker.outputs.publish == 'true' | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| marker="snapshot/latest" | ||
| git tag --force "${marker}" HEAD | ||
| git push --force origin "refs/tags/${marker}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
build-plugin/plugin/src/main/kotlin/net/thunderbird/gradle/plugin/bom/BomPlugin.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package net.thunderbird.gradle.plugin.bom | ||
|
|
||
| import org.gradle.api.Plugin | ||
| import org.gradle.api.Project | ||
| import org.gradle.api.plugins.JavaPlatformExtension | ||
| import org.gradle.kotlin.dsl.configure | ||
|
|
||
| class BomPlugin : Plugin<Project> { | ||
|
|
||
| override fun apply(target: Project) { | ||
| with(target) { | ||
| pluginManager.apply("java-platform") | ||
| pluginManager.apply("net.thunderbird.gradle.plugin.changelog") | ||
| pluginManager.apply("net.thunderbird.gradle.plugin.versioning") | ||
| pluginManager.apply("net.thunderbird.gradle.plugin.publishing") | ||
|
|
||
| extensions.configure<JavaPlatformExtension> { | ||
| allowDependencies() | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.