Skip to content

Push

Push #110

name: Push
on:
workflow_run:
workflows: [ Pull Request ]
types: [ completed ]
jobs:
build:
permissions:
contents: read
checks: write
actions: read
id-token: write
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
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
if: ${{ github.event.workflow_run.conclusion == 'success' }}
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 }}