Skip to content

v3.0.17

v3.0.17 #21

Workflow file for this run

# 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/mic'
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 17 βš™οΈ
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: Validate Gradle wrapper βš™οΈ
uses: gradle/actions/wrapper-validation@v4
- 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 17 βš™οΈ
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: Validate Gradle wrapper βš™οΈ
uses: gradle/actions/wrapper-validation@v4
- 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 17 βš™οΈ
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: Validate Gradle wrapper βš™οΈ
uses: gradle/actions/wrapper-validation@v4
- 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 }}