diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index a36dbf2..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish to PyPI - -on: - push: - tags: - - "v*" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Set up Poetry - uses: ./.github/actions/setup-poetry - - name: Install dependencies - run: poetry install - - name: Build package - run: poetry build --no-interaction - - name: Upload build artifact - uses: actions/upload-artifact@v7 - with: - path: dist/ - name: package-dist - - publish: - runs-on: ubuntu-latest - needs: build - environment: pypi - permissions: - id-token: write - steps: - - name: Download build artifact - uses: actions/download-artifact@v8 - with: - path: ${{ github.workspace }}/dist/ - name: package-dist - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2438b5d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,86 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + releases_created: ${{ steps.release.outputs.releases_created }} + steps: + - name: Release Please + id: release + uses: googleapis/release-please-action@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + build: + runs-on: ubuntu-latest + needs: release-please + if: needs.release-please.outputs.releases_created == 'true' + steps: + - uses: actions/checkout@v6 + - name: Set up Poetry + uses: ./.github/actions/setup-poetry + - name: Install dependencies + run: poetry install + - name: Build package + run: poetry build --no-interaction + - name: Upload build artifact + uses: actions/upload-artifact@v7 + with: + path: dist/ + name: package-dist + + publish: + runs-on: ubuntu-latest + needs: [release-please, build] + if: needs.release-please.outputs.releases_created == 'true' + environment: pypi + permissions: + id-token: write + steps: + - name: Download build artifact + uses: actions/download-artifact@v8 + with: + path: ${{ github.workspace }}/dist/ + name: package-dist + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + docs: + runs-on: ubuntu-latest + needs: release-please + if: needs.release-please.outputs.releases_created == 'true' + permissions: + contents: write + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Set up Poetry + uses: ./.github/actions/setup-poetry + - name: Install dependencies + run: poetry install --with docs + - name: Build HTML + run: poetry run make -C docs/ html + - name: Upload artifacts + uses: actions/upload-artifact@v7 + with: + name: html-docs + path: docs/_build/html + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/_build/html diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml deleted file mode 100644 index d1e26ac..0000000 --- a/.github/workflows/sphinx.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build and deploy Sphinx documentation - -on: - push: - tags: - - "v*" - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v6 - with: - persist-credentials: false - - name: Set up Poetry - uses: ./.github/actions/setup-poetry - - name: Install dependencies - run: poetry install --with docs - - name: Build HTML - run: poetry run make -C docs/ html - - name: Upload artifacts - uses: actions/upload-artifact@v7 - with: - name: html-docs - path: docs/_build/html - - name: Deploy - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/_build/html diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..fa97484 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.2.16" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..4ea4fb1 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,9 @@ +{ + "release-type": "python", + "include-component-in-tag": false, + "include-v-in-tag": true, + "bump-minor-pre-major": true, + "packages": { + ".": {} + } +}