v1.5.5 #20
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: Build 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/[email protected] | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/[email protected] | |
with: | |
distribution: 'temurin' | |
java-version: 23 | |
- name: Setup Gradle | |
uses: gradle/actions/[email protected] | |
- 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 }} | |
run: ./gradlew -Pversion=$VERSION build sourcesJar dokkaGeneratePublicationHtml publish jreleaserDeploy | |
- name: List build/staging-deploy (only on failure) | |
if: failure() | |
run: ls -R build/staging-deploy | |
- name: Display JReleaser trace.log (only on failure) | |
if: failure() | |
run: | | |
if [ -f build/jreleaser/trace.log ]; then | |
echo "trace.log Content:" | |
tail -1000 build/jreleaser/trace.log | |
else | |
echo "trace.log file not found" | |
fi | |
- name: Checkout main branch (only if releasing from main) | |
if: github.ref == 'refs/heads/main' | |
uses: actions/[email protected] | |
with: | |
ref: main | |
fetch-depth: 0 | |
- name: Update README (only if releasing from main) | |
if: github.ref == 'refs/heads/main' | |
run: sh .github/scripts/update-readme-version.sh | |
- name: Create Pull Request (only if releasing from main) | |
if: github.ref == 'refs/heads/main' | |
uses: stefanzweifel/[email protected] | |
with: | |
commit_message: Dependency version in README.md updated to ${{ env.VERSION }} | |
file_pattern: 'README.md' |