From 1e02f0a2c498564d0892b2fedefef57af5c79022 Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Wed, 20 Nov 2024 12:59:53 -0800 Subject: [PATCH 1/4] add comment explaining workflow, add environment declaration for DockerHub --- .github/workflows/pypi_publish.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 969005160..473aa4700 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -1,3 +1,7 @@ +# This workflow builds the python package. +# On release tags, it also publishes to PyPI and DockerHub. +# If we rename the workflow file name, we have to also update the +# Trusted Publisher settings on PyPI. name: Packaging and Publishing on: @@ -61,6 +65,9 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest needs: [publish] + environment: + name: DockerHub + url: https://hub.docker.com/r/airbyte/source-declarative-manifest/tags steps: - uses: actions/checkout@v4 From 1c380c744958a7d747ac5792679b0f98925c99f2 Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Wed, 20 Nov 2024 13:20:42 -0800 Subject: [PATCH 2/4] remove 'v' prefix in docker image tag --- .github/workflows/pypi_publish.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 473aa4700..1e33fe4c4 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -77,14 +77,20 @@ jobs: - name: Set Version (workflow_dispatch) if: github.event_name == 'workflow_dispatch' run: | - echo "Version set to ${{ github.event.inputs.version }}" + echo "Version input set to ${{ github.event.inputs.version }}" + # Remove the 'v' prefix if it exists + VERSION=${VERSION#v} echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV - name: Set Version (tag) if: startsWith(github.ref, 'refs/tags/v') run: | - echo "Version set to ${{ github.ref_name }}" - echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV + echo "Version ref set to '${{ github.ref_name }}'" + VERSION=${{ github.ref_name }} + # Remove the 'v' prefix if it exists + VERSION=${VERSION#v} + echo "Setting version to '$VERSION'" + echo "VERSION=${VERSION}" >> $GITHUB_ENV # We need to download the build artifact again because the previous job was on a different runner - name: Download Build Artifact From 49f8b93637ec3d79bd4baadaf13b037bae10384e Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Wed, 20 Nov 2024 13:25:54 -0800 Subject: [PATCH 3/4] fix refs --- .github/workflows/pypi_publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 1e33fe4c4..16b0eeeaf 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -79,8 +79,10 @@ jobs: run: | echo "Version input set to ${{ github.event.inputs.version }}" # Remove the 'v' prefix if it exists + VERSION=${{ github.event.inputs.version }} VERSION=${VERSION#v} - echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "Setting version to '$VERSION'" + echo "VERSION=${VERSION}" >> $GITHUB_ENV - name: Set Version (tag) if: startsWith(github.ref, 'refs/tags/v') From 16f294a4f7d8e15997470d5fa951aa3c63f5ec54 Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Wed, 20 Nov 2024 13:28:30 -0800 Subject: [PATCH 4/4] update variable handling logic --- .github/workflows/pypi_publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 16b0eeeaf..1d63c9cc6 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -77,9 +77,9 @@ jobs: - name: Set Version (workflow_dispatch) if: github.event_name == 'workflow_dispatch' run: | - echo "Version input set to ${{ github.event.inputs.version }}" - # Remove the 'v' prefix if it exists VERSION=${{ github.event.inputs.version }} + echo "Version input set to '${VERSION}'" + # Remove the 'v' prefix if it exists VERSION=${VERSION#v} echo "Setting version to '$VERSION'" echo "VERSION=${VERSION}" >> $GITHUB_ENV @@ -87,8 +87,8 @@ jobs: - name: Set Version (tag) if: startsWith(github.ref, 'refs/tags/v') run: | - echo "Version ref set to '${{ github.ref_name }}'" VERSION=${{ github.ref_name }} + echo "Version ref set to '${VERSION}'" # Remove the 'v' prefix if it exists VERSION=${VERSION#v} echo "Setting version to '$VERSION'"