-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: release to maven on merge (#1423)
Creates a new github action pipeline that runs on merge to `master`. The pipeline will: 1. Create a new commit with an updated CHANGELOG.md 2. Tag that commit and push it to `master` 3. Make a clean checkout of that commit 4. Build, sign, and release all java artefacts to maven Depends on #1422 to set up the secrets in github
- Loading branch information
1 parent
55fd706
commit ade2893
Showing
7 changed files
with
121 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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,10 @@ | ||
[tool.commitizen] | ||
name = "cz_conventional_commits" | ||
tag_format = "v$version" | ||
version_scheme = "semver" | ||
version_provider = "scm" | ||
update_changelog_on_bump = true | ||
version_files = [ | ||
"gradle.properties:projectVersion=" | ||
] | ||
changelog_start_rev = "v1.0.0" |
This file contains 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 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,52 @@ | ||
name: Release | ||
|
||
permissions: | ||
# The commitizen action pushes a new commit to the main | ||
# branch to generate the changelog + tag, so needs write | ||
# permission | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
bump_version: | ||
if: "!startsWith(github.event.head_commit.message, 'bump:')" | ||
runs-on: ubuntu-latest | ||
name: "Bump version" | ||
outputs: | ||
version: ${{ steps.cz.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch tags, which are required to calculate the new version | ||
token: "${{ secrets.GITHUB_TOKEN }}" | ||
- id: cz | ||
name: "Generate Changelog and Tag" | ||
uses: commitizen-tools/commitizen-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
release: | ||
needs: bump_version | ||
runs-on: ubuntu-latest | ||
name: "Release" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.bump_version.outputs.version }} | ||
- name: "Set up JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: gradle | ||
- name: "Sign and Release" | ||
env: | ||
GRADLE_SIGNING_KEY: "${{ secrets.GRADLE_SIGNING_KEY }}" | ||
GRADLE_SIGNING_PASSWORD: "${{ secrets.GRADLE_SIGNING_PASSWORD }}" | ||
OSSRH_USERNAME: "${{ secrets.OSSRH_USERNAME }}" | ||
OSSRH_PASSWORD: "${{ secrets.OSSRH_PASSWORD }}" | ||
# Exclude client-rest as it's not part of the java release | ||
run: ./gradlew clean build sign uploadArchives --exclude-task :client-rest:uploadArchives |
This file contains 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 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 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 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