Skip to content

Commit

Permalink
prepare release to use environments (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored Apr 24, 2023
1 parent 1144885 commit 7ef842a
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,20 @@ jobs:
- run: coverage combine
- run: coverage xml

- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
env_vars: PYTHON,OS

deploy:
name: Deploy
release:
name: Release
needs: [lint, test]
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
environment: release

permissions:
id-token: write

steps:
- uses: actions/checkout@v2
Expand All @@ -87,21 +91,17 @@ jobs:
python-version: '3.10'

- name: install
run: pip install -U twine build packaging
run: pip install -U build

- name: check version
id: check-version
run: python <(curl -Ls https://gist.githubusercontent.com/samuelcolvin/4e1ad439c5489e8d6478cdee3eb952ef/raw/check_version.py)
env:
VERSION_PATH: 'pydantic_settings/version.py'
- name: check GITHUB_REF matches package version
uses: samuelcolvin/[email protected]
with:
version_file_path: pydantic_settings/version.py

- name: build
run: python -m build

- run: twine check dist/*

- name: upload to pypi
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 7ef842a

Please sign in to comment.