Bump gradle/wrapper-validation-action from 1.1.0 to 3.3.2 (#211) #351
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
# Regular build for all pushes and pull requests | |
name: Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
gradleValidation: | |
name: Validate Gradle Wrapper | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/[email protected] | |
properties: | |
name: Export Properties | |
if: (github.event_name != 'pull_request') && (github.ref == 'refs/heads/main') | |
needs: gradleValidation | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.properties.outputs.version }} | |
changelog: ${{ steps.properties.outputs.changelog }} | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: Export Properties | |
id: properties | |
shell: bash | |
run: | | |
PROPERTIES="$(./gradlew properties --console=plain -q)" | |
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" | |
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" | |
CHANGELOG="${CHANGELOG//'%'/'%25'}" | |
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" | |
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" | |
echo "::set-output name=version::$VERSION" | |
echo "::set-output name=changelog::$CHANGELOG" | |
checks: | |
name: Run Checks | |
needs: gradleValidation | |
runs-on: macos-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: Run Unit Tests | |
run: ./gradlew allTests --stacktrace | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
path: 'build/test-results/**/*.xml' | |
- name: Run Detekt | |
if: always() | |
run: ./gradlew detekt --stacktrace | |
- name: Generate Detekt Annotations | |
if: always() | |
uses: jwgmeligmeyling/checkstyle-github-action@master | |
with: | |
path: 'build/reports/detekt.xml' | |
reports: | |
name: Publish Reports | |
needs: checks | |
runs-on: ubuntu-latest | |
if: success() || failure() | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Download Test Results | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Publish Test Report | |
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | |
with: | |
files: 'artifacts/**/*.xml' | |
dokka: | |
name: Generate Dokka Documentation | |
needs: gradleValidation | |
runs-on: macos-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: Generate Documentation | |
run: ./gradlew dokkaJavadocCommon dokkaJekyllCommon --stacktrace | |
assemble: | |
name: Assemble Library | |
needs: gradleValidation | |
runs-on: macos-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: Assemble Library | |
run: ./gradlew assemble --stacktrace | |
releaseDraft: | |
name: Draft New Release | |
if: (github.event_name != 'pull_request') && (github.ref == 'refs/heads/main') | |
needs: properties | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Remove Old Release Drafts | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases \ | |
| tr '\r\n' ' ' \ | |
| jq '.[] | select(.draft == true) | .id' \ | |
| xargs -I '{}' \ | |
curl -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/{} | |
- name: Create Release Draft | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ needs.properties.outputs.version }} | |
release_name: v${{ needs.properties.outputs.version }} | |
body: ${{ needs.properties.outputs.changelog }} | |
draft: true | |
localSnapshot: | |
name: Publish Snapshot Locally | |
if: (github.event_name == 'pull_request') || (github.ref != 'refs/heads/main') | |
needs: gradleValidation | |
runs-on: macos-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: Publish Snapshot Locally | |
run: ./gradlew publish --stacktrace | |
snapshot: | |
name: Publish To OSSRH Snapshot Repository | |
if: (github.event_name != 'pull_request') && (github.ref == 'refs/heads/main') | |
needs: gradleValidation | |
runs-on: macos-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: Decrypt Key Ring File | |
env: | |
SIGNING_KEY_FILE_PASSPHRASE: ${{ secrets.signingKeyFilePassphrase }} | |
run: .github/scripts/decrypt_secring | |
- name: Publish To OSSRH Snapshot Repository | |
env: | |
SIGNING_KEY_ID: ${{ secrets.signingKeyId }} | |
SIGNING_PASS: ${{ secrets.signingPassword }} | |
SONATYPE_USERNAME: ${{ secrets.ossrhUsername }} | |
SONATYPE_PASSWORD: ${{ secrets.ossrhPassword }} | |
run: .github/scripts/publish_artifacts SNAPSHOT |