-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (35 loc) · 1.08 KB
/
Copy pathrelease.yaml
File metadata and controls
43 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Publish release to PyPI
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine wheel
- name: Verify version matches release tag
run: |
PACKAGE_VERSION=$(grep -m 1 "version" pyproject.toml | cut -d'"' -f2)
TAG_VERSION=${GITHUB_REF#refs/tags/v}
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
echo "Error: Package version ($PACKAGE_VERSION) does not match release tag ($TAG_VERSION)"
exit 1
fi
- name: Build package
run: python -m build
- name: Check distribution
run: |
python -m twine check dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_REPELLO_ARTEMIS_SDK_KEY }}