diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3fe7c4df..da888dee 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,19 +18,16 @@ jobs: timeout-minutes: 30 steps: - - name: Checkout the repo - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Java - uses: actions/setup-java@v3 + - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 11 + java-version: 17 - - name: Build - uses: gradle/gradle-build-action@v2 + - uses: gradle/gradle-build-action@v2 with: arguments: build --scan --full-stacktrace @@ -44,51 +41,3 @@ jobs: with: name: error-report path: build-reports.zip - - docs: - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Dokka - id: Dokka - run: ./gradlew cleanDocs dokkaHtml - - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Auto update docs - - publish: - env: - SONATYPE_USER: '${{ secrets.SONATYPE_USER }}' - SONATYPE_PWD: '${{ secrets.SONATYPE_PWD }}' - OSS_USER: '${{ secrets.OSS_USER }}' - OSS_TOKEN: '${{ secrets.OSS_TOKEN }}' - OSS_STAGING_PROFILE_ID: '${{ secrets.OSS_STAGING_PROFILE_ID }}' - SIGNING_KEY_NAME: '${{ secrets.SIGNING_KEY_NAME }}' - SIGNING_KEY_ID: '${{ secrets.SIGNING_KEY_ID }}' - SIGNING_KEY_PASSPHRASE: '${{ secrets.SIGNING_KEY_PASSPHRASE }}' - SIGNING_KEY: '${{ secrets.SIGNING_KEY }}' - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Java - uses: actions/setup-java@v3.13.0 - with: - distribution: 'zulu' - java-version: 11 - - - name: Publish to MavenCentral - run: ./gradlew build publishToSonatype - - - name: Stop Gradle daemons - run: ./gradlew --stop diff --git a/.github/workflows/githubpages.yaml b/.github/workflows/githubpages.yaml new file mode 100644 index 00000000..cee3fd1d --- /dev/null +++ b/.github/workflows/githubpages.yaml @@ -0,0 +1,28 @@ +name: githubpages + +on: + release: + types: [published] + +env: + GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" + +jobs: + githubpages: + runs-on: ubuntu-latest + timeout-minutes: 20 + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: gradle/gradle-build-action@v2 + with: + arguments: -Pversion=${{ github.event.release.tag_name }} dokkaHtml + + - name: Deploy to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0069c2bf..5291b701 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -16,19 +16,16 @@ jobs: timeout-minutes: 30 steps: - - name: Checkout the repo - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Java - uses: actions/setup-java@v3 + - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 11 + java-version: 17 - - name: Build - uses: gradle/gradle-build-action@v2 + - uses: gradle/gradle-build-action@v2 with: arguments: build --scan --full-stacktrace diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..6f19cfb2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,49 @@ +name: "Publish library" + +on: + workflow_dispatch: + branches: [main] + inputs: + version: + description: 'Version' + required: true + type: string + +env: + JAVA_OPTS: -Xms1g -Xmx3g + GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" + ORG_GRADLE_PROJECT_mavenCentralUsername: '${{ secrets.SONATYPE_USER }}' + ORG_GRADLE_PROJECT_mavenCentralPassword: '${{ secrets.SONATYPE_PWD }}' + ORG_GRADLE_PROJECT_signingInMemoryKeyId: '${{ secrets.SIGNING_KEY_ID }}' + ORG_GRADLE_PROJECT_signingInMemoryKey: '${{ secrets.SIGNING_KEY }}' + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: '${{ secrets.SIGNING_KEY_PASSPHRASE }}' + +jobs: + publish: + timeout-minutes: 30 + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 8 + + - uses: gradle/gradle-build-action@v2 + with: + arguments: assemble -Pversion=${{ inputs.version }} + + - name: Upload reports + if: failure() + uses: actions/upload-artifact@v3 + with: + name: 'reports-${{ matrix.os }}' + path: '**/build/reports/**' + + - name: Publish final version + uses: gradle/gradle-build-action@v2 + with: + arguments: -Pversion=${{ inputs.version }} publishAllPublicationsToMavenCentralRepository