-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
238 additions
and
75 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,18 @@ | ||
changelog: | ||
categories: | ||
- title: 🎉 New Features | ||
labels: | ||
- feature | ||
- title: 🐞 Bug Fixes | ||
labels: | ||
- bug | ||
- title: 🔨 Refactoring | ||
labels: | ||
- refactoring | ||
- title: 📔 Documentation | ||
labels: | ||
- docs | ||
- title: 🛠️ Misc | ||
labels: | ||
- Technical Debt | ||
- chore |
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,51 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-tag: | ||
description: 'Release Tag' | ||
required: false | ||
default: 'services_XXX_apps_XXX' | ||
maven-new-version: | ||
description: '(Optional) Specify new maven version - SNAPSHOT will be added to the version' | ||
required: false | ||
|
||
jobs: | ||
release-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: PREP / actions/checkout@v4 | ||
- name: PREP / Prepare mvnw | ||
run: chmod +x ./mvnw | ||
- name: PREP / Remove snapshot from services | ||
run: ./mvnw versions:set --batch-mode -DremoveSnapshot -DprocessAllModules | ||
- name: PREP / Set services release version env variable | ||
run: echo "SERVICES_RELEASE_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
outputs: | ||
services-release-version: ${{ env.SERVICES_RELEASE_VERSION }} | ||
|
||
release-services: | ||
needs: release-version | ||
uses: ./.github/workflows/workflow-build-and-release-services.yml | ||
with: | ||
release-version: ${{ needs.release-version.outputs.services-release-version }} | ||
snapshot-release: false | ||
maven-release: true | ||
docker-release: true | ||
secrets: inherit | ||
|
||
github-release: | ||
needs: release-services | ||
uses: ./.github/workflows/workflow-github-release.yaml | ||
with: | ||
release-tag: ${{ github.event.inputs.release-tag }} | ||
secrets: inherit | ||
|
||
bump-versions: | ||
needs: github-release | ||
uses: ./.github/workflows/workflow-bump-version.yaml | ||
with: | ||
new-maven-version: ${{ github.event.inputs.maven-new-version }} | ||
secrets: inherit | ||
|
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,77 @@ | ||
name: Bump version | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
new-maven-version: | ||
description: 'New maven version' | ||
type: string | ||
required: false | ||
workflow_dispatch: | ||
inputs: | ||
new-maven-version: | ||
description: 'New maven version' | ||
type: string | ||
required: false | ||
|
||
jobs: | ||
bump-versions: | ||
name: Bumps versions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: PREP / Checkout code | ||
uses: actions/checkout@v4 | ||
- name: PREP / Setup git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Miranum Github Bot" | ||
- name: PREP / Prepare mvnw | ||
run: chmod +x ./mvnw | ||
- name: PREP / Install Java and Maven | ||
if: inputs.bump-services-version== true | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' | ||
|
||
- name: BUMP VERSION / Raise mvn version | ||
if: inputs.new-maven-version != '' | ||
run: | | ||
./mvnw versions:set --batch-mode -DprocessAllModules -DnewVersion=${{ inputs.new-maven-version }}-SNAPSHOT -DprocessAllModules | ||
./mvnw versions:commit -DprocessAllModules | ||
- name: BUMP VERSION / Raise mvn version | ||
if: inputs.new-maven-version == '' | ||
run: | | ||
./mvnw build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0-SNAPSHOT -DprocessAllModules | ||
./mvnw versions:commit -DprocessAllModules | ||
- name: GIT / Git commit | ||
run: | | ||
git add . | ||
git commit -m "chore: mvn auto version bump to $(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" | ||
- name: GIT / Push changes to new branch | ||
run: | | ||
git checkout -b ${{ github.ref_name }}-version-bump | ||
git push --force origin ${{ github.ref_name }}-version-bump | ||
- name: GIT / Create pull request | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const { repo, owner } = context.repo; | ||
const pullResult = await github.rest.pulls.create({ | ||
title: 'chore: bump release version ${{ github.ref_name }}', | ||
owner, | ||
repo, | ||
head: '${{ github.ref_name }}-version-bump', | ||
base: '${{ github.ref_name }}', | ||
body: [ | ||
'This PR is auto-generated' | ||
].join('\n') | ||
}); | ||
await github.rest.issues.addAssignees({ | ||
owner, | ||
repo, | ||
issue_number: pullResult.data.number, | ||
assignees: ['${{ github.actor }}'], | ||
}); | ||
console.log(`Pull Request created: ${pullResult.data.html_url}`); |
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,36 @@ | ||
name: Github Release | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
release-tag: | ||
description: 'Release tag' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
github-release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: PREP / Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: GIT / Create tag | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/${{ inputs.release-tag }}', | ||
sha: context.sha | ||
}) | ||
- name: GIT / Create GitHub Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: ${{ inputs.release-tag }} | ||
draft: false | ||
prerelease: false | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# CICD | ||
|
||
We use GitHub Actions for CICD Pipelines. The pipelines are defined in the `.github/workflows` directory. | ||
|
||
## Workflows | ||
|
||
### Build | ||
|
||
**Feature Branches** | ||
|
||
Build the project using Maven on each commit and PR to the `main` branch. | ||
|
||
```mermaid | ||
graph LR | ||
A[Checkout] --> B[Maven Build] | ||
``` | ||
|
||
**Main Branch** | ||
|
||
Every new commit to the `main` branch builds the project using Maven and builds and releases Docker Images to Docker Hub with the tag `dev`. | ||
|
||
```mermaid | ||
graph LR | ||
A[Checkout] --> B[Maven Build] | ||
B --> C[Docker Build and Push] | ||
``` | ||
|
||
### Release | ||
|
||
Releases are triggered by dispatching the Release workflow manually. | ||
The release workflow creates a new maven release and builds and releases Docker Images to Docker Hub with a version tag. | ||
Additionally, a GitHub Release is created with auto generated release notes and finally the Maven version is bumped to the next snapshot version (or the version specified with the workflow dispatch). | ||
|
||
```mermaid | ||
graph LR | ||
A[Checkout] --> B[Maven Build and Release] | ||
B --> C[Docker Build and Push] | ||
C --> D[Github Release] | ||
D --> E[Maven Version Bump] | ||
``` | ||
|