Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 45 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,54 @@
name: Deploy
name: Deploy to PyPI

on:
workflow_dispatch:
release:
types:
- published

jobs:
release:
publish-to-test-pypi:
runs-on: ubuntu-latest
environment:
name: test
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Build the distribution
run: make build
- name: Install the package
run: make test-install-build
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-to-pypi:
runs-on: ubuntu-latest
environment:
name: production
# if release to test PyPI fails, still run this job
# since we can check the reason for failure manually
# before approving the release
if: always()
needs: publish-to-test-pypi
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- run: make install-dev
- run: make build
- run: make test-install-build
- env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: make deploy
- name: Build the distribution
run: make build
- name: Install the package
run: make test-install-build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Release
name: Create Release

on:
push:
branches:
- 'main'
workflow_dispatch:

jobs:
release:
Expand All @@ -12,10 +10,13 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: pnpm/action-setup@v2
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- env:
- name: Install dependencies
run: pnpm install
- name: Generate a release
env:
GITHUB_TOKEN: ${{ secrets.CLI_PAT }}
run: pnpm run release
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: trailing-whitespace
- id: no-commit-to-branch
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.5.0
rev: v9.22.0
hooks:
- id: commitlint
stages: [commit-msg]
Expand Down
Loading