Skip to content

Commit 7ef842a

Browse files
authored
prepare release to use environments (#20)
1 parent 1144885 commit 7ef842a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,20 @@ jobs:
6767
- run: coverage combine
6868
- run: coverage xml
6969

70-
- uses: codecov/codecov-action@v2
70+
- uses: codecov/codecov-action@v3
7171
with:
7272
file: ./coverage.xml
7373
env_vars: PYTHON,OS
7474

75-
deploy:
76-
name: Deploy
75+
release:
76+
name: Release
7777
needs: [lint, test]
7878
if: "success() && startsWith(github.ref, 'refs/tags/')"
7979
runs-on: ubuntu-latest
80+
environment: release
81+
82+
permissions:
83+
id-token: write
8084

8185
steps:
8286
- uses: actions/checkout@v2
@@ -87,21 +91,17 @@ jobs:
8791
python-version: '3.10'
8892

8993
- name: install
90-
run: pip install -U twine build packaging
94+
run: pip install -U build
9195

92-
- name: check version
93-
id: check-version
94-
run: python <(curl -Ls https://gist.githubusercontent.com/samuelcolvin/4e1ad439c5489e8d6478cdee3eb952ef/raw/check_version.py)
95-
env:
96-
VERSION_PATH: 'pydantic_settings/version.py'
96+
- name: check GITHUB_REF matches package version
97+
uses: samuelcolvin/check-python-version@v3.1
98+
with:
99+
version_file_path: pydantic_settings/version.py
97100

98101
- name: build
99102
run: python -m build
100103

101104
- run: twine check dist/*
102105

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

0 commit comments

Comments
 (0)