2.0.0 #5
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: Publish | |
on: | |
workflow_dispatch: | |
release: | |
types: [ prereleased, released ] | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: Publish library | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: setup-java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- name: Cache Gradle | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Deploy to Sonatype | |
run: | | |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3) | |
echo "New version: ${NEW_VERSION}" | |
export ORG_GRADLE_PROJECT_VERSION_NAME=${NEW_VERSION} | |
echo "RELEASE_VERSION=$NEW_VERSION" >> "$GITHUB_ENV" | |
./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache --stacktrace | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | |
- name: Update README for ${{ env.RELEASE_VERSION }} | |
run: ./.github/version.sh "${RELEASE_VERSION}" | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Commit changes to README to ${{ env.branch }} | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: "./README.md" | |
message: "Update README.md with version ${{env.RELEASE_VERSION}}" | |
new_branch: ${{ steps.extract_branch.outputs.branch }} | |
documentation: | |
name: "Generate Documentation" | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup-java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- name: Cache Gradle | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Generate documentation | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: dokkaHtmlMultiModule | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dokka/ |