Update build.gradle.kts #255
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: Push | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
permissions: | |
contents: read | |
checks: write | |
actions: read | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- uses: gradle/[email protected] | |
with: | |
arguments: test --continue --no-daemon | |
gradle-home-cache-cleanup: true | |
- uses: dorny/[email protected] | |
if: always() | |
with: | |
name: test | |
path: "*/build/test-results/test/TEST-*.xml" | |
reporter: java-junit | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # include git tags | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- uses: paulhatch/[email protected] | |
id: tag | |
with: | |
bump_each_commit: true | |
tag_prefix: "" | |
- id: notes | |
run: | | |
randomDelimiter=${RANDOM} | |
text="$(git --no-pager log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")" | |
echo 'CHANGELOG<<$randomDelimiter' >> $GITHUB_OUTPUT | |
echo $text >> $GITHUB_OUTPUT | |
echo '$randomDelimiter' >> $GITHUB_OUTPUT | |
- uses: actions/[email protected] | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.version }} | |
release_name: ${{ steps.tag.outputs.version }} | |
body: | | |
Changes in this Release | |
${{ steps.notes.outputs.CHANGELOG }} | |
- uses: gradle/[email protected] | |
with: | |
arguments: -Pversion=${{ steps.tag.outputs.version }} publish | |
gradle-home-cache-cleanup: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |