From c5fe443b5e208fc0570f2fa0ace17bd784cb5a8d Mon Sep 17 00:00:00 2001 From: Pia Date: Tue, 13 Aug 2024 10:45:20 -0400 Subject: [PATCH] cd fix --- .github/workflows/merge.yml | 21 +++++++++++++++++---- setup.py | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 691068d4..173109a6 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -4,32 +4,36 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: build-and-push: runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/hdp-cairo-dev permissions: + contents: read id-token: write steps: - name: Checkout code uses: actions/checkout@v2 - name: Log in to Docker Hub + if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Create remote builder certificates + if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: | echo "${{ secrets.BUILDKIT_CA_PEM }}" > ${{ github.workspace }}/client-ca.pem echo "${{ secrets.BUILDKIT_CERT_PEM }}" > ${{ github.workspace }}/client-cert.pem echo "${{ secrets.BUILDKIT_KEY_PEM }}" > ${{ github.workspace }}/client-key.pem - name: Set up Docker Buildx + if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: docker/setup-buildx-action@v3 with: driver: remote @@ -41,6 +45,7 @@ jobs: cleanup: true - name: Build and push Docker image + if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: docker/build-push-action@v5 with: file: environment.dockerfile @@ -62,5 +67,13 @@ jobs: run: | python setup.py sdist bdist_wheel - - name: Publish package distributions to PyPI + - name: Check PyPI package (dry run) + run: | + twine check dist/* + echo "Package check completed. In a real publish, the package would be uploaded to PyPI." + + - name: Publish package to PyPI + if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/setup.py b/setup.py index b96e26be..ae24394a 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ def run(self): name="hdp-cairo-dev", long_description=long_description, long_description_content_type="text/markdown", - version="0.0.6", + version="0.0.7", packages=[ "tools", "contract_bootloader",