File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Publish
2+
3+ on :
4+ push :
5+ tags : ["v*"]
6+
7+ jobs :
8+ build-and-publish :
9+ name : Build and Publish
10+ environment : protected
11+ permissions :
12+ contents : read
13+ id-token : write
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
18+
19+ - name : Setup Python
20+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
21+ with :
22+ python-version : " 3.10"
23+
24+ - name : Install Poetry
25+ uses : abatilo/actions-poetry@e78f54a89cb052fff327414dd9ff010b5d2b4dbd
26+
27+ - name : Configure Poetry
28+ run : |
29+ poetry config virtualenvs.create true --local
30+ poetry config virtualenvs.in-project true --local
31+
32+ - name : Install package
33+ run : poetry install
34+
35+ - name : Validate version
36+ run : |
37+ TAG_VERSION=${GITHUB_REF#refs/tags/v}
38+ POETRY_VERSION=$(poetry version -s)
39+
40+ if [ "$TAG_VERSION" != "$POETRY_VERSION" ]; then
41+ echo "Tag ($TAG_VERSION) doesn't match pyproject.toml ($POETRY_VERSION)"
42+ exit 1
43+ fi
44+
45+ - name : Build package
46+ run : poetry build
47+
48+ - name : Publish to PyPI
49+ uses : pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc
You can’t perform that action at this time.
0 commit comments