generated from creek-service/multi-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update with the latest conventions and workflows (#99)
* Update with the latest conventions and workflows Release prep. Add conventions for releasing to Maven Central And while at it, add some for common setup and coverage
- Loading branch information
1 parent
83d6b3b
commit 85cf94c
Showing
16 changed files
with
462 additions
and
224 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,21 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- documentation | ||
- subtask | ||
- chore | ||
categories: | ||
- title: Breaking Changes 🛠 | ||
labels: [ breaking-change ] | ||
|
||
- title: Exciting New Features 🎉 | ||
labels: [ enhancement ] | ||
|
||
- title: Bug Fixes 🎉 | ||
labels: [ bug ] | ||
|
||
- title: Dependency Updates | ||
labels: [ dependencies ] | ||
|
||
- title: Less Exciting Things | ||
labels: [ "*" ] |
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,63 @@ | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: [ "v*.*.*" ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
inputs: | ||
publish_artifacts: | ||
description: "Publish release artifacts: true or false?" | ||
default: "true" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Fetch version history | ||
# Do NOT want to fetch all tags if build specific tag. | ||
# Doing so could result in code published with wrong version, if newer tags have been pushed | ||
if: (!startsWith(github.ref, 'refs/tags/')) | ||
run: git fetch --tag --unshallow | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: gradle | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
run: ./gradlew check coveralls | ||
- name: Publish | ||
if: github.event_name == 'push' || github.event.inputs.publish_artifacts == 'true' | ||
env: | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} | ||
ORG_GRADLE_PROJECT_SONA_USERNAME: ${{ secrets.SONA_USERNAME }} | ||
ORG_GRADLE_PROJECT_SONA_PASSWORD: ${{ secrets.SONA_PASSWORD }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
./gradlew cV | ||
./gradlew publish closeSonatypeStagingRepository # todo: switch to releasing once happy. | ||
create-gh-release: | ||
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-alpha') | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Create GitHut Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: true |
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 was deleted.
Oops, something went wrong.
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,33 @@ | ||
# A Workflow for triggering a new release. | ||
|
||
name: Release | ||
|
||
on: [workflow_dispatch] | ||
|
||
concurrency: "${{ github.repository }}-versioning" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
token: ${{ secrets.TRIGGER_GITHUB_TOKEN }} | ||
- name: Fetch version history | ||
run: git fetch --tags --unshallow | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: gradle | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Ensure build is green | ||
run: ./gradlew check | ||
- name: Release | ||
run: | | ||
# The following command will trigger the build.yml workflow as it pushes a release tag | ||
./gradlew release | ||
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 |
---|---|---|
@@ -1,18 +1,27 @@ | ||
name: Version | ||
# A Workflow for adjusting the version number of the next release | ||
|
||
name: Set next version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
part: | ||
description: "Part to increment: Major, Minor or Patch" | ||
description: "Part to increment: Major, Minor, Patch or the next release, e.g. 1.2.3" | ||
required: true | ||
default: Patch | ||
default: Minor | ||
|
||
concurrency: "${{ github.repository }}-versioning" | ||
|
||
jobs: | ||
version: | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
with: | ||
token: ${{ secrets.TRIGGER_GITHUB_TOKEN }} | ||
- name: Fetch version history | ||
run: git fetch --tags --unshallow | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
|
@@ -21,12 +30,13 @@ jobs: | |
cache: gradle | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Increment Version Part | ||
- name: Increment version | ||
if: contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part) | ||
run: | | ||
git fetch --tags --unshallow | ||
# The following command will trigger the build.yml workflow as it pushes a alpha tag | ||
./gradlew markNextVersion -Prelease.incrementer=increment${{ github.event.inputs.part }} | ||
- name: Trigger Build | ||
- name: Set next version | ||
if: (!contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part)) | ||
run: | | ||
curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${{ github.repository }}/actions/workflows/gradle.yml/dispatches" -d '{"ref":"main","inputs":{"publish":"true"}}' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TRIGGER_GITHUB_TOKEN }} | ||
# The following command will trigger the build.yml workflow as it pushes a alpha tag | ||
./gradlew markNextVersion -Prelease.version=${{ github.event.inputs.part }} |
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 |
---|---|---|
|
@@ -10,3 +10,6 @@ out | |
*.ipr | ||
*.iws | ||
.idea | ||
|
||
# Apple | ||
**/.DS_Store |
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
Oops, something went wrong.