Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: disable SDM publish step #81

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 77 additions & 77 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,80 +60,80 @@ jobs:
- name: Publish to PyPI
uses: pypa/[email protected]

publish_sdm:
name: Publish SDM to DockerHub
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
with:
fetch-depth: 0

- name: Set Version (workflow_dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
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

- name: Set Version (tag)
if: startsWith(github.ref, 'refs/tags/v')
run: |
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'"
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
uses: actions/download-artifact@v4
with:
name: Packages-${{ github.run_id }}
path: dist

- name: Set up QEMU for multi-platform builds
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Check for existing tag
run: |
tag="airbyte/source-declarative-manifest:${{ env.VERSION }}"
if [ -z "$tag" ]; then
echo "Error: VERSION is not set. Ensure the tag follows the format 'refs/tags/vX.Y.Z'."
exit 1
fi
echo "Checking if tag '$tag' exists on DockerHub..."
if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "$tag" > /dev/null 2>&1; then
echo "The tag '$tag' already exists on DockerHub. Skipping publish to prevent overwrite."
exit 1
fi
echo "No existing tag '$tag' found. Proceeding with publish."

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
airbyte/source-declarative-manifest:latest
airbyte/source-declarative-manifest:${{ env.VERSION }}
airbyte/source-declarative-manifest:${{ github.sha }}
# publish_sdm:
# name: Publish SDM to DockerHub
# 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
# with:
# fetch-depth: 0

# - name: Set Version (workflow_dispatch)
# if: github.event_name == 'workflow_dispatch'
# run: |
# 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

# - name: Set Version (tag)
# if: startsWith(github.ref, 'refs/tags/v')
# run: |
# 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'"
# 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
# uses: actions/download-artifact@v4
# with:
# name: Packages-${{ github.run_id }}
# path: dist

# - name: Set up QEMU for multi-platform builds
# uses: docker/setup-qemu-action@v3

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}

# - name: Check for existing tag
# run: |
# tag="airbyte/source-declarative-manifest:${{ env.VERSION }}"
# if [ -z "$tag" ]; then
# echo "Error: VERSION is not set. Ensure the tag follows the format 'refs/tags/vX.Y.Z'."
# exit 1
# fi
# echo "Checking if tag '$tag' exists on DockerHub..."
# if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "$tag" > /dev/null 2>&1; then
# echo "The tag '$tag' already exists on DockerHub. Skipping publish to prevent overwrite."
# exit 1
# fi
# echo "No existing tag '$tag' found. Proceeding with publish."

# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: .
# platforms: linux/amd64,linux/arm64
# push: true
# tags: |
# airbyte/source-declarative-manifest:latest
# airbyte/source-declarative-manifest:${{ env.VERSION }}
# airbyte/source-declarative-manifest:${{ github.sha }}
Loading