Workflow file for this run
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: Release - Publish and update to next version | |
on: | |
release: | |
types: [prereleased, released] | |
concurrency: | |
group: release | |
cancel-in-progress: false | |
jobs: | |
publish-workflow: | |
strategy: | |
matrix: | |
profile: [ p231, p232, p233, p241, p242 ] | |
uses: ./.github/workflows/publish-workflow.yml | |
with: | |
build-profile: ${{ matrix.profile }} | |
tag-name: ${{ github.event.release.tag_name }} | |
changelog: ${{ github.event.release.body }} | |
secrets: inherit | |
update-to-next-version: | |
needs: [ publish-workflow ] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 | |
token: ${{ secrets.GH_ADMIN_TOKEN }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.301 | |
- name: Export Changelog | |
id: exportchangelog | |
shell: bash | |
run: | | |
CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d' | |
${{ github.event.release.body }} | |
EOM | |
)" | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "changelog<<$EOF" >> "$GITHUB_OUTPUT" | |
echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
echo "$EOF" >> "$GITHUB_OUTPUT" | |
# Update changelog | |
- name: Patch Changelog | |
if: ${{ steps.exportchangelog.outputs.changelog != '' }} | |
env: | |
CHANGELOG: ${{ steps.exportchangelog.outputs.changelog }} | |
run: | | |
./gradlew --no-configuration-cache patchChangelog --release-note="$CHANGELOG" | |
- name: Increment version | |
run: | | |
./gradlew --no-configuration-cache incrementSemanticVersionPatch | |
./gradlew --no-configuration-cache printSemanticVersion -q | |
- name: Commit next version to main | |
run: | | |
VERSION=$(cat version.properties |grep "version="|cut -d= -f2) | |
git config user.name github-actions | |
git config user.email [email protected] | |
git stash | |
git pull | |
git stash pop | |
git add version.properties | |
git add CHANGELOG.md | |
git commit -m "increment version after publish to ${VERSION} and update changelog [skip ci]" | |
git push | |
prepare-release-draft: | |
needs: [ update-to-next-version ] | |
uses: ./.github/workflows/release-draft.yml | |
secrets: inherit |