From 1a23e09e8aafe1710ed9bf77988efd2ac0b98594 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 1 Apr 2025 10:04:30 +0800 Subject: [PATCH 1/6] Replace composite deployment with the normal one --- .github/actions/deploy-site/action.yml | 22 ---------------------- .github/workflows/deploy.yml | 16 ++++++++++++++-- .github/workflows/release.yml | 7 ++----- 3 files changed, 16 insertions(+), 29 deletions(-) delete mode 100644 .github/actions/deploy-site/action.yml diff --git a/.github/actions/deploy-site/action.yml b/.github/actions/deploy-site/action.yml deleted file mode 100644 index d4d2e8a03..000000000 --- a/.github/actions/deploy-site/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Deploy Site' -description: 'Deploy site to GitHub Pages' - -runs: - using: 'composite' - steps: - - uses: gradle/actions/setup-gradle@v4 - with: - cache-read-only: true - - name: Prepare API documentation - shell: bash - run: ./gradlew dokkaHtml - - name: Build Site - shell: bash - run: | - # Don't cache it to track updates. - pip install mkdocs-material - mkdocs build - - uses: actions/upload-pages-artifact@v3 - with: - path: site - - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1be19d144..bfa8c94ed 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,9 +10,21 @@ jobs: environment: name: github-pages permissions: - contents: write id-token: write pages: write steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/deploy-site + - uses: gradle/actions/setup-gradle@v4 + with: + cache-read-only: true + - name: Prepare API documentation + run: ./gradlew dokkaHtml + - name: Build Site + run: | + # Don't cache it to track updates. + pip install mkdocs-material + mkdocs build + - uses: actions/upload-pages-artifact@v3 + with: + path: site + - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b77555ac..373f95b96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,12 +9,8 @@ jobs: release: runs-on: ubuntu-latest if: github.event.repository.fork == false - environment: - name: github-pages permissions: contents: write - id-token: write - pages: write steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -33,7 +29,8 @@ jobs: ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} - - uses: ./.github/actions/deploy-site + - name: Deploy Site + uses: ./.github/workflows/deploy.yml - name: Extract release notes uses: ffurrer2/extract-release-notes@v2 with: From ac8b50909321f6da573615dc6778e4a96b4036ed Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 1 Apr 2025 10:10:28 +0800 Subject: [PATCH 2/6] Remove limits for testing --- .github/workflows/release.yml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 373f95b96..698c39f25 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: tags: - '**' + pull_request: jobs: release: @@ -21,22 +22,22 @@ jobs: with: cache-read-only: true # TODO: https://github.com/gradle/gradle/issues/22779 - - run: ./gradlew publishToMavenCentral publishPlugins --no-configuration-cache - env: - GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }} - GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }} - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} +# - run: ./gradlew publishToMavenCentral publishPlugins --no-configuration-cache +# env: +# GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }} +# GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }} +# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }} +# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} +# ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} +# ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} - name: Deploy Site uses: ./.github/workflows/deploy.yml - - name: Extract release notes - uses: ffurrer2/extract-release-notes@v2 - with: - changelog_file: docs/changes/README.md - release_notes_file: RELEASE_NOTES.md - - name: Create release - run: gh release create ${{ github.ref_name }} --notes-file RELEASE_NOTES.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# - name: Extract release notes +# uses: ffurrer2/extract-release-notes@v2 +# with: +# changelog_file: docs/changes/README.md +# release_notes_file: RELEASE_NOTES.md +# - name: Create release +# run: gh release create ${{ github.ref_name }} --notes-file RELEASE_NOTES.md +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 72ff0e3804cbcc416e4ec33e882f5e12739a3290 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 1 Apr 2025 10:20:26 +0800 Subject: [PATCH 3/6] Move ./.github/workflows/deploy.yml usage into a new job --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 698c39f25..9612d5e5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,8 +30,6 @@ jobs: # ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} # ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} # ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} - - name: Deploy Site - uses: ./.github/workflows/deploy.yml # - name: Extract release notes # uses: ffurrer2/extract-release-notes@v2 # with: @@ -41,3 +39,7 @@ jobs: # run: gh release create ${{ github.ref_name }} --notes-file RELEASE_NOTES.md # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + deploy: + needs: release + uses: ./.github/workflows/deploy.yml From 4df369ba7425e6b0f80b4a0ca47c1ba986fc3ed5 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 1 Apr 2025 10:23:13 +0800 Subject: [PATCH 4/6] Add workflow_call --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bfa8c94ed..a07bac0ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,7 @@ name: Deploy on: + workflow_call: workflow_dispatch: jobs: From c6f1f5d003ecc72ea001e04c31c2e497500868f8 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 1 Apr 2025 10:26:12 +0800 Subject: [PATCH 5/6] Add maven-central env for release job --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9612d5e5a..f374f479e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,8 @@ jobs: release: runs-on: ubuntu-latest if: github.event.repository.fork == false + environment: + name: maven-central permissions: contents: write steps: From 3849d6809301a7d9fd662dd6355024497d0270f6 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 1 Apr 2025 10:39:12 +0800 Subject: [PATCH 6/6] Revert "Remove limits for testing" This reverts commit ac8b5090 --- .github/workflows/release.yml | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f374f479e..245de4902 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,6 @@ on: push: tags: - '**' - pull_request: jobs: release: @@ -24,23 +23,23 @@ jobs: with: cache-read-only: true # TODO: https://github.com/gradle/gradle/issues/22779 -# - run: ./gradlew publishToMavenCentral publishPlugins --no-configuration-cache -# env: -# GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }} -# GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }} -# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }} -# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} -# ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} -# ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} -# - name: Extract release notes -# uses: ffurrer2/extract-release-notes@v2 -# with: -# changelog_file: docs/changes/README.md -# release_notes_file: RELEASE_NOTES.md -# - name: Create release -# run: gh release create ${{ github.ref_name }} --notes-file RELEASE_NOTES.md -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./gradlew publishToMavenCentral publishPlugins --no-configuration-cache + env: + GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }} + GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} + - name: Extract release notes + uses: ffurrer2/extract-release-notes@v2 + with: + changelog_file: docs/changes/README.md + release_notes_file: RELEASE_NOTES.md + - name: Create release + run: gh release create ${{ github.ref_name }} --notes-file RELEASE_NOTES.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} deploy: needs: release