v3.2.1 #11
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
# This workflow will publish the release to Maven Central Repository | |
name: Publish Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: ποΈ Build Release | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
if: github.repository == 'w3stling/tickersymbol' | |
steps: | |
- name: Checkout repository βοΈ | |
uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Setup Java 21 βοΈ | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Setup Gradle dependencies cache βοΈ | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} | |
- name: Setup Gradle wrapper cache βοΈ | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Version number π’ | |
run: | | |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3 | cut -c2-) | |
echo "New version: ${NEW_VERSION}" | |
echo "new_version=${NEW_VERSION}" >> $GITHUB_ENV | |
echo "year=$(date +%Y)" >> $GITHUB_ENV | |
- name: Update README.md π | |
uses: bluwy/substitute-string-action@v3 | |
with: | |
_input-file: './.github/README-template.md' | |
_output-file: ./README.md | |
_format-key: '%%key%%' | |
env: | |
INPUT_VERSION: ${{ env.new_version }} | |
INPUT_YEAR: ${{ env.year }} | |
- name: Commit README.md | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
id: auto-commit-action-readme | |
with: | |
commit_message: Update version to ${{ env.new_version }} | |
file_pattern: README.md | |
branch: master | |
- name: "README.md - changes have been detected π" | |
if: steps.auto-commit-action-readme.outputs.changes_detected == 'true' | |
run: echo "Updated README.md with release version ${{ env.new_version }} β " | |
- name: Build release ποΈ | |
run: ./gradlew clean build javadoc -x test | |
documentation: | |
name: π Publish Javadoc | |
needs: [build] | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository βοΈ | |
uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Setup Java 21 βοΈ | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Setup Gradle dependencies cache βοΈ | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} | |
- name: Setup Gradle wrapper cache βοΈ | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Version number π’ | |
run: | | |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3 | cut -c2-) | |
echo "New version: ${NEW_VERSION}" | |
echo "new_version=${NEW_VERSION}" >> $GITHUB_ENV | |
echo "year=$(date +%Y)" >> $GITHUB_ENV | |
- name: Generate Javadoc π | |
run: ./gradlew javadoc | |
- name: Deploy Javadoc π | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: build/docs/javadoc | |
target-folder: javadoc/${{ env.new_version }} | |
commit-message: Publishing javadoc | |
clean: true | |
dry-run: false | |
publish-release: | |
needs: [build] | |
name: π Publish Release | |
permissions: | |
contents: write | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository βοΈ | |
uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Setup Java 21 βοΈ | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Setup Gradle dependencies cache βοΈ | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} | |
- name: Setup Gradle wrapper cache βοΈ | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Version number π’ | |
run: | | |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3 | cut -c2-) | |
echo "New version: ${NEW_VERSION}" | |
echo "new_version=${NEW_VERSION}" >> $GITHUB_ENV | |
echo "year=$(date +%Y)" >> $GITHUB_ENV | |
- name: Publish release build π | |
env: | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }} | |
run: | | |
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ env.new_version }} |