Skip to content

Commit f1c3dd7

Browse files
committed
Merge tag 'v5.2.5' into develop
release 5.2
2 parents 36ecd74 + 43082ee commit f1c3dd7

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ jobs:
3636
- name: Build Package
3737
run: python3 -m build
3838

39-
- name: Read version string
40-
id: run_version
41-
run: |
42-
PYPI_VERSION=$(python setup.py --version)
43-
[[ ${PYPI_VERSION} =~ ^[0-9]+\.[0-9]+\.[0-9]+.* ]] || {
44-
echo "ERROR: unexpected version string '${PYPI_VERSION}'" >&2
45-
exit 1
46-
}
47-
echo ::set-output name=pypi_version::${PYPI_VERSION}
48-
4939
- name: Publish Test Package
5040
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
5141
with:
@@ -59,8 +49,30 @@ jobs:
5949
name: netfoundry-pypi-${{ github.run_id }}
6050
path: dist/netfoundry-*.tar.gz
6151

52+
- name: Read version string
53+
id: read_version
54+
run: |
55+
PYPI_VERSION=$(python setup.py --version)
56+
[[ ${PYPI_VERSION} =~ ^[0-9]+\.[0-9]+\.[0-9]+.* ]] || {
57+
echo "ERROR: unexpected version string '${PYPI_VERSION}'" >&2
58+
exit 1
59+
}
60+
echo ::set-output name=pypi_version::${PYPI_VERSION}
61+
62+
- name: Append 'latest' tag if release published
63+
env:
64+
GITHUB_ACTION: ${{ github.event.action }}
65+
PYPI_VERSION: ${{ steps.read_version.outputs.pypi_version }}
66+
id: compose_tags
67+
run: |
68+
CONTAINER_TAGS="netfoundry/python:${PYPI_VERSION}"
69+
if [[ ${GITHUB_ACTION} == "published" ]]; then
70+
CONTAINER_TAGS+=",netfoundry/python:latest"
71+
fi
72+
echo ::set-output name=container_tags::${CONTAINER_TAGS}
73+
6274
- name: Publish Release Package
63-
if: github.event.action == "published"
75+
if: github.event.action == 'published'
6476
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
6577
with:
6678
user: __token__
@@ -88,4 +100,4 @@ jobs:
88100
builder: ${{ steps.buildx.outputs.name }}
89101
platforms: linux/amd64,linux/arm/v7,linux/arm64
90102
push: true
91-
tags: netfoundry/python:${{ steps.run_version.outputs.pypi_version }}
103+
tags: ${{ steps.compose_tags.outputs.container_tags }}

0 commit comments

Comments
 (0)