From 374e9190b77e3064c69d04e069151d2cfd9ab65e Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Thu, 27 Apr 2023 13:03:32 -0400 Subject: [PATCH] chore: update release workflows (#131) --- .github/workflows/ci.yml | 23 ----------------------- .github/workflows/docs.yml | 27 +++++++++++++++++++++------ .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53a2efde..a6746136 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 63953f2a..4d56546c 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 00000000..3c63339b --- /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 }}