Skip to content

v0.1.6

v0.1.6 #7

Workflow file for this run

name: Build release
description: Builds the release
on:
release:
types: [ published ]
jobs:
build_release:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Checkout sources
uses: actions/checkout@v4.2.2
- name: Setup Java
uses: actions/setup-java@v4.6.0
with:
distribution: 'temurin'
java-version: 23
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4.2.2
- name: Build
env:
ORG_GRADLE_PROJECT_githubActor: ${{ secrets.GITHUBACTOR }}
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUBTOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
JRELEASER_DISCORD_WEBHOOK: ${{ secrets.DISCORD_ANNOUCEMENTS_WEBHOOK }}
run: ./gradlew -Pversion=$VERSION build sourcesJar javadocJar signPluginMavenPublication publish jreleaserDeploy jreleaserAnnounce
- name: Display JReleaser trace.log (only on failure)
if: failure()
run: |
if [ -f build/jreleaser/trace.log ]; then
echo "trace.log Content:"
cat build/jreleaser/trace.log
else
echo "trace.log file not found"
fi
- name: Get target branch for tag
run: |
git fetch --all
TARGET_BRANCH=$(git branch -r --contains $GITHUB_REF | grep -v "HEAD" | head -n 1 | sed 's/origin\///')
echo "Target branch for tag: $TARGET_BRANCH"
echo "TARGET_BRANCH=$TARGET_BRANCH" >> $GITHUB_ENV
- name: Checkout target branch
uses: actions/checkout@v4.2.2
with:
ref: ${{ env.TARGET_BRANCH }}
fetch-depth: 0
- name: Update README
run: ./gradlew -Pversion=$VERSION updateVersionInReadme
- name: Commit README.md pointing to released version
uses: stefanzweifel/git-auto-commit-action@v5.1.0
with:
commit_message: Dependency version in README.md updated to ${{ env.VERSION }}
file_pattern: 'README.md'