diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53a2efd..a674613 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,8 +4,6 @@ on: push: branches: - main - tags: - - "v*" pull_request: workflow_dispatch: @@ -35,24 +33,3 @@ jobs: - run: | pip install --upgrade hatch hatch run test - - Deploy: - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }} - run: | - python -m build - twine upload dist/* diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 63953f2..4d56546 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,12 +1,25 @@ name: Build and Deploy + on: push: branches: - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + jobs: build-and-deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -16,10 +29,12 @@ jobs: - run: | python -m pip install --upgrade hatch hatch run docs - touch dist/.nojekyll - - name: Deploy 🚀 - uses: peaceiris/actions-gh-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist + path: dist + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3c63339 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + + Release: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - run: | + pip install --upgrade hatch + hatch build + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TWINE_API_KEY }} + + - run: npx changelogithub@0.12 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}