From f796d42704539f6c3f6a33afe0c290e58cb5412e Mon Sep 17 00:00:00 2001 From: Tushar Saini Date: Mon, 3 Jun 2024 00:26:05 +0530 Subject: [PATCH] [UPD] update ci-cd --- .github/workflows/test.yml | 1 + .github/workflows/workflow.yml | 53 +++------------------------------- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b98320..765e897 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,7 @@ on: push: branches: - "**" + - "!main" pull_request: branches: main diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b3b3ea7..d50f89d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,12 +2,10 @@ name: Publish RetailTree Python package distribution to PyPI on: push: + paths: + - "setup.py" branches: - - main - workflow_run: - workflows: ["Run Tests"] - types: - - completed + - "main" jobs: build: @@ -37,7 +35,7 @@ jobs: publish-to-pypi: name: >- Publish RetailTree Python package distribution to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: - build runs-on: ubuntu-latest @@ -55,46 +53,3 @@ jobs: path: dist/ - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - - github-release: - name: >- - Sign the Python 🐍 distribution 📦 with Sigstore - and upload them to GitHub Release - needs: - - publish-to-pypi - runs-on: ubuntu-latest - - permissions: - contents: write # IMPORTANT: mandatory for making GitHub Releases - id-token: write # IMPORTANT: mandatory for sigstore - - steps: - - name: Download all the dists - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Sign the dists with Sigstore - uses: sigstore/gh-action-sigstore-python@v2.1.1 - with: - inputs: >- - ./dist/*.tar.gz - ./dist/*.whl - - name: Create GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - run: >- - gh release create - '${{ github.ref_name }}' - --repo '${{ github.repository }}' - --notes "" - - name: Upload artifact signatures to GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - # Upload to GitHub Release using the `gh` CLI. - # `dist/` contains the built packages, and the - # sigstore-produced signatures and certificates. - run: >- - gh release upload - '${{ github.ref_name }}' dist/** - --repo '${{ github.repository }}'