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

added buildx to workflows #24

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
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
37 changes: 0 additions & 37 deletions .github/workflows/docker-stable.yml

This file was deleted.

27 changes: 2 additions & 25 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ jobs:
Install with:
\`\`\`bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsync==${version}
\`\`\`

Docker image: \`socketdev/cli:pr-${prNumber}\`
`;
\`\`\``;

if (botComment) {
// Update existing comment
Expand Down Expand Up @@ -131,24 +128,4 @@ jobs:
sleep 20
done
echo "success=false" >> $GITHUB_OUTPUT
exit 1

- name: Login to Docker Hub
if: steps.verify_package.outputs.success == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build & Push Docker Preview
if: steps.verify_package.outputs.success == 'true'
uses: docker/build-push-action@v5
env:
VERSION: ${{ env.VERSION }}
with:
push: true
tags: socketdev/cli:pr-${{ github.event.pull_request.number }}
build-args: |
CLI_VERSION=${{ env.VERSION }}
PIP_INDEX_URL=https://test.pypi.org/simple
PIP_EXTRA_INDEX_URL=https://pypi.org/simple
exit 1
52 changes: 1 addition & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ jobs:
echo "pypi_exists=false" >> $GITHUB_OUTPUT
fi

- name: Check Docker image existence
id: docker_check
env:
VERSION: ${{ env.VERSION }}
run: |
if curl -s -f "https://hub.docker.com/v2/repositories/socketdev/cli/tags/${{ env.VERSION }}" > /dev/null; then
echo "Docker image socketdev/cli:${VERSION} already exists"
echo "docker_exists=true" >> $GITHUB_OUTPUT
else
echo "docker_exists=false" >> $GITHUB_OUTPUT
fi

- name: Build package
if: steps.version_check.outputs.pypi_exists != 'true'
run: |
Expand All @@ -58,42 +46,4 @@ jobs:
if: steps.version_check.outputs.pypi_exists != 'true'
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_TOKEN }}

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

- name: Verify package is installable
id: verify_package
env:
VERSION: ${{ env.VERSION }}
run: |
for i in {1..30}; do
if pip install socketsync==${VERSION}; then
echo "Package ${VERSION} is now available and installable on PyPI"
pip uninstall -y socketsync
echo "success=true" >> $GITHUB_OUTPUT
exit 0
fi
echo "Attempt $i: Package not yet installable, waiting 20s... (${i}/30)"
sleep 20
done
echo "success=false" >> $GITHUB_OUTPUT
exit 1

- name: Build & Push Docker
if: |
steps.verify_package.outputs.success == 'true' &&
steps.docker_check.outputs.docker_exists != 'true'
uses: docker/build-push-action@v5
env:
VERSION: ${{ env.VERSION }}
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
socketdev/cli:latest
socketdev/cli:${{ env.VERSION }}
password: ${{ secrets.PYPI_TOKEN }}
Loading