-
Notifications
You must be signed in to change notification settings - Fork 26
50 lines (40 loc) · 1.28 KB
/
publish.yml
File metadata and controls
50 lines (40 loc) · 1.28 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
44
45
46
47
48
49
50
---
name: Build and Publish
on:
push:
tags: ["v*"]
jobs:
build-and-publish:
name: Build and Publish
environment: protected
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- name: Setup Python
uses: actions/setup-python@28f2168f4d98ee0445e3c6321f6e6616c83dd5ec
with:
python-version: "3.14"
- name: Install Poetry
uses: abatilo/actions-poetry@b8f6fe29ba2eb78e0d45ccbf41cd14154c4e25b2
- name: Configure Poetry
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Install package
run: poetry install
- name: Validate version
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
POETRY_VERSION=$(poetry version -s)
if [ "$TAG_VERSION" != "$POETRY_VERSION" ]; then
echo "Tag ($TAG_VERSION) doesn't match pyproject.toml ($POETRY_VERSION)"
exit 1
fi
- name: Build package
run: poetry build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b