CD - Release #26
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
name: CD - Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "Build Release" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "Setup Java JDK" | |
uses: actions/setup-java@v3.13.0 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- id: vars | |
name: "Determine Tag Name" | |
run: | | |
VERSION_LINE=$(cat gradle.properties | grep "version=") | |
CURRENT_VERSION=${VERSION_LINE//version=/} | |
TAG_VERSION=v${CURRENT_VERSION//-SNAPSHOT/} | |
echo ::set-output name=tag::$TAG_VERSION | |
- name: "Prepare Git" | |
run: | | |
git config --global user.email "84719472+raynigon-bot@users.noreply.github.com" | |
git config --global user.name "raynigon[bot]" | |
git checkout -b release | |
- name: "Publish Artifacts" | |
uses: eskatos/gradle-command-action@d1b726d8c1e0cc120447ad1a950d6e6794c51ad8 #v1.3.3 | |
with: | |
arguments: ":release -Prelease.useAutomaticVersion=true build -x test" | |
wrapper-cache-enabled: true | |
dependencies-cache-enabled: true | |
env: | |
GITHUB_USERNAME: raynigon | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_PRIVATE_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_KEY_PASSPHRASE }} | |
- name: Copy Assets | |
run: | | |
mkdir -p build/libs/ | |
cp spring-boot-core-starter/build/libs/*.jar build/libs/ | |
cp spring-boot-jackson-starter/build/libs/*.jar build/libs/ | |
cp spring-boot-jpa-starter/build/libs/*.jar build/libs/ | |
cp spring-boot-springdoc-starter/build/libs/*.jar build/libs/ | |
cp unit-api-core/build/libs/*.jar build/libs/ | |
cp unit-api-jackson/build/libs/*.jar build/libs/ | |
cp unit-api-kotlin/build/libs/*.jar build/libs/ | |
- id: content | |
name: Create Release Content | |
uses: raynigon/release-documentation@main | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
latest: "${{ steps.vars.outputs.tag }}" | |
template: | | |
# What's Changed | |
<!-- Features & Enhancements --> | |
{{#pull_requests.feature.length}} | |
## 🚀 Features & Enhancements | |
{{#pull_requests.feature}} | |
* {{ title }} PR: #{{ number }} | |
{{/pull_requests.feature}} | |
{{/pull_requests.feature.length}} | |
<!-- Bug Fixes --> | |
{{#pull_requests.bug.length}} | |
## 🐛 Bug Fixes | |
{{#pull_requests.bug}} | |
* {{ title }} PR: #{{ number }} | |
{{/pull_requests.bug}} | |
{{/pull_requests.bug.length}} | |
<!-- Documentation --> | |
{{#pull_requests.documentation.length}} | |
## 📖 Documentation | |
{{#pull_requests.documentation}} | |
* {{ title }} PR: #{{ number }} | |
{{/pull_requests.documentation}} | |
{{/pull_requests.documentation.length}} | |
<!-- Housekeeping --> | |
{{#pull_requests.housekeeping.length}} | |
## 🧹 Housekeeping | |
{{#pull_requests.housekeeping}} | |
* {{ title }} PR: #{{ number }} | |
{{/pull_requests.housekeeping}} | |
{{/pull_requests.housekeeping.length}} | |
<!-- Dependency updates --> | |
{{#pull_requests.dependencies.length}} | |
## 📦 Dependency updates | |
{{#pull_requests.dependencies}} | |
* {{ title }} PR: #{{ number }} | |
{{/pull_requests.dependencies}} | |
{{/pull_requests.dependencies.length}} | |
- name: "Github Release" | |
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d #v1 | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
with: | |
tag_name: "${{ steps.vars.outputs.tag }}" | |
name: "${{ steps.vars.outputs.tag }}" | |
files: build/libs/*.jar | |
body: ${{ steps.content.outputs.content }} |