Skip to content

Commit dab9811

Browse files
committed
ci: rework release workflow as tag-triggered pipeline
Reworks release.yml to conform to the umbrella SDK release pipeline contract (u5c-factory reference/sdk-pipeline-requirements.md): a v* version tag triggers build -> test -> publish and the package version is derived from the tag. Fixes the previous workflow, which referenced an undefined inputs.registry-token in a non-workflow_call workflow so the PyPI token always resolved empty. Verification: workflow YAML syntactically validated only; not executed this session. Requires the PYPI_REGISTRY_TOKEN repository secret before the first release. Based on main, independent of the in-flight spec-0.19 branch.
1 parent 7ddea48 commit dab9811

1 file changed

Lines changed: 45 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,56 @@
1-
name: "Release"
2-
description: 'Publishes python package to PyPI'
1+
name: Release
32

3+
# Conforms to the umbrella SDK release pipeline contract:
4+
# u5c-factory reference/sdk-pipeline-requirements.md
45
on:
5-
workflow_dispatch:
66
push:
7-
tags: [v*]
7+
tags: ['v*']
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- uses: actions/checkout@v4
14+
- run: pipx install poetry
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.10"
18+
cache: poetry
19+
# Relock first: poetry.lock is stale vs pyproject.toml (see ci.yml).
20+
- run: poetry lock
21+
- run: poetry install
22+
- run: poetry build
1323

14-
- name: Set up Python
15-
uses: actions/setup-python@v5
16-
with:
17-
python-version: "3.10"
24+
test:
25+
needs: build
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- run: pipx install poetry
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.10"
33+
cache: poetry
34+
- run: poetry lock
35+
- run: poetry install
36+
# No pytest suite yet; import-smoke the package (see ci.yml).
37+
- run: poetry run python -c "import utxorpc"
38+
39+
publish:
40+
needs: test
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- run: pipx install poetry
45+
- uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.10"
48+
cache: poetry
1849

19-
- name: Install Poetry
20-
shell: bash
21-
run: pip install --no-input poetry
50+
- name: Set package version from tag
51+
run: poetry version "${GITHUB_REF_NAME#v}"
2252

23-
- name: Publish to PyPI
24-
shell: bash
25-
env:
26-
PYPI_TOKEN: ${{ inputs.registry-token }}
27-
run: |
28-
poetry publish --build --username __token__ --password $PYPI_TOKEN
53+
- name: Publish to PyPI
54+
env:
55+
PYPI_REGISTRY_TOKEN: ${{ secrets.PYPI_REGISTRY_TOKEN }}
56+
run: poetry publish --build --username __token__ --password "$PYPI_REGISTRY_TOKEN"

0 commit comments

Comments
 (0)