-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (61 loc) · 1.79 KB
/
release.yml
File metadata and controls
66 lines (61 loc) · 1.79 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Release
# Conforms to the umbrella SDK release pipeline contract:
# u5c-factory reference/sdk-pipeline.md
on:
push:
tags: ['v*']
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify tag matches package version
run: |
TAG="${GITHUB_REF_NAME#v}"
MANIFEST=$(sed -nE 's/^version = "(.+)"/\1/p' pyproject.toml | head -1)
if [ "$TAG" != "$MANIFEST" ]; then
echo "::error::tag $GITHUB_REF_NAME does not match pyproject.toml version $MANIFEST"
exit 1
fi
build:
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: poetry
# Relock first: poetry.lock is stale vs pyproject.toml (see ci.yml).
- run: poetry lock
- run: poetry install
- run: poetry build
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: poetry
- run: poetry lock
- run: poetry install
# No pytest suite yet; import-smoke the package (see ci.yml).
- run: poetry run python -c "import utxorpc"
publish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: poetry
- name: Publish to PyPI
env:
PYPI_REGISTRY_TOKEN: ${{ secrets.PYPI_REGISTRY_TOKEN }}
run: poetry publish --build --username __token__ --password "$PYPI_REGISTRY_TOKEN"