Skip to content

Commit 34c0b61

Browse files
committed
use the PyPi version for container image tag
1 parent aa540dd commit 34c0b61

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ jobs:
3636
- name: Build Package
3737
run: python3 -m build
3838

39+
- name: Test installing the build
40+
41+
- name: Read version string
42+
id: run_version
43+
run: |
44+
PYPI_VERSION=$(python3 -m netfoundry.version)
45+
[[ ${PYPI_VERSION} =~ ^v[0-9]\s+\.[0-9]\s+\.[0-9]\s+.* ]] || {
46+
echo "ERROR: unexpected version string" >&2
47+
exit 1
48+
}
49+
echo ::set-output name=pypi_version::${PYPI_VERSION}
50+
3951
- name: Publish Test Package
4052
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
4153
with:
@@ -89,4 +101,4 @@ jobs:
89101
builder: ${{ steps.buildx.outputs.name }}
90102
platforms: linux/amd64,linux/arm/v7,linux/arm64
91103
push: true
92-
tags: netfoundry/python:kentest
104+
tags: netfoundry/python:${{ steps.run_version.outputs.pypi_version }}

0 commit comments

Comments
 (0)