Skip to content

Commit 8a53b8a

Browse files
authored
Merge pull request #15 from wherka-ama/main
fix(ci): correct image tagging and PyPI publishing logic
2 parents fe77cd0 + 715b08e commit 8a53b8a

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/release-oci-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
outputs:
3333
generated_version: ${{ steps.output-generated-version.outputs.generated_version }}
3434
image_tag: ${{ steps.generate_tag.outputs.image_tag }}
35-
image_tag_latest: ${{ steps.output-generated-version.outputs.image_tag_latest }}
35+
image_tag_latest: ${{ steps.generate_tag.outputs.image_tag_latest }}
3636
tag_prefix: ${{ steps.generate_tag.outputs.tag_prefix }}
3737
permissions:
3838
contents: write
@@ -57,7 +57,6 @@ jobs:
5757
id: output-generated-version
5858
run: |
5959
echo "generated_version=${{ steps.semantic-version.outputs.version }}" >> $GITHUB_OUTPUT
60-
echo "image_tag_latest=${{ env.OCI_REGISTRY }}/${repo_name}:latest" >> $GITHUB_OUTPUT
6160
6261
-
6362
name: Version tag ${{ steps.semantic-version.outputs.version }} on main branch or tag
@@ -85,6 +84,7 @@ jobs:
8584
# image tag needs to be all lower case
8685
repo_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
8786
echo "image_tag=${{ env.OCI_REGISTRY }}/${repo_name}:${{ env.generated_tag }}" >> $GITHUB_OUTPUT
87+
echo "image_tag_latest=${{ env.OCI_REGISTRY }}/${repo_name}:latest" >> $GITHUB_OUTPUT
8888
8989
docker-image-release:
9090
needs: [generate-release-version]

.github/workflows/release-pypi.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- v*
77
branches:
88
- main
9+
# paths-ignore:
10+
# - .github/**
11+
# - ./**/*.md
912
pull_request:
1013
branches:
1114
- main
@@ -119,8 +122,8 @@ jobs:
119122
120123
publish-to-testpypi:
121124
name: Publish Python 🐍 distribution 📦 to TestPyPI
122-
# we only publish to TestPyPI on tag pushes or merge to main
123-
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
125+
# we only publish to TestPyPI on merge to main
126+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
124127
needs:
125128
- build
126129
runs-on: ubuntu-latest
@@ -141,4 +144,6 @@ jobs:
141144
- name: Publish distribution 📦 to TestPyPI
142145
uses: pypa/gh-action-pypi-publish@release/v1
143146
with:
144-
repository-url: https://test.pypi.org/legacy/
147+
repository-url: https://test.pypi.org/legacy/
148+
skip-existing: true
149+
verbose: true

0 commit comments

Comments
 (0)