Skip to content

Commit

Permalink
👷 Add release step (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Jun 26, 2023
1 parent 035bb03 commit 01afb78
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
extra_args: --all-files


tests:
test:
name: "Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest

Expand All @@ -47,3 +47,46 @@ jobs:

- name: Run tests
run: hatch run test

check: # This job does nothing and is only used for the branch protection
if: always()
needs: [lint, test]
runs-on: ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
id: all-green
with:
jobs: ${{ toJSON(needs) }}

release:
name: Release
needs: [check]
if: success() && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

permissions:
id-token: write

steps:
- uses: actions/checkout@v2

- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: install
run: pip install -U build

- name: check GITHUB_REF matches package version
uses: samuelcolvin/[email protected]
with:
version_file_path: bump_pydantic/__init__.py

- name: build
run: python -m build

- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 01afb78

Please sign in to comment.