From 147c01eadb3b951b84487c4328f553f95b16fb47 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 5 Jul 2024 15:56:45 +0200 Subject: [PATCH] build(ci): fix automated documentation publication at releasing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .github/workflows/publish-documentation.yml | 47 --------------------- .github/workflows/release-please.yml | 40 +++++++++++++++++- 2 files changed, 39 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/publish-documentation.yml diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml deleted file mode 100644 index 8692cf6f..00000000 --- a/.github/workflows/publish-documentation.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Publish documentation - -on: - workflow_dispatch: - workflow_call: - -jobs: - publish-documentation: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: 'pnpm' - - - name: Generate documentation - run: | - pnpm install --ignore-scripts --frozen-lockfile - pnpm typedoc - - - name: Commit files - if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' - env: - COMMIT_MESSAGE: 'docs: generate documentation' - COMMIT_AUTHOR: Documentation Bot - COMMIT_EMAIL: documentation-bot@users.noreply.github.com - run: | - git config --local user.name "${{ env.COMMIT_AUTHOR }}" - git config --local user.email "${{ env.COMMIT_EMAIL }}" - git pull - git add ./docs - git commit -a -m "${{ env.COMMIT_MESSAGE }}" - - - name: Push changes - if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' - uses: CasperWA/push-protected@v2 - with: - token: ${{ secrets.GH_TOKEN_PROTECTED }} - branch: ${{ github.event.repository.default_branch }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 7aab4017..f70ab97a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -129,5 +129,43 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-documentation: - uses: ./.github/workflows/publish-documentation.yml needs: [publish-npm, publish-jsr] + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'pnpm' + + - name: Generate documentation + run: | + pnpm install --ignore-scripts --frozen-lockfile + pnpm typedoc + + - name: Commit files + if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' + env: + COMMIT_MESSAGE: 'docs: generate documentation' + COMMIT_AUTHOR: Documentation Bot + COMMIT_EMAIL: documentation-bot@users.noreply.github.com + run: | + git config --local user.name "${{ env.COMMIT_AUTHOR }}" + git config --local user.email "${{ env.COMMIT_EMAIL }}" + git pull + git add ./docs + git commit -a -m "${{ env.COMMIT_MESSAGE }}" + + - name: Push changes + if: github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' + uses: CasperWA/push-protected@v2 + with: + token: ${{ secrets.GH_TOKEN_PROTECTED }} + branch: ${{ github.event.repository.default_branch }} -- 2.34.1