From 5c5f9dd02a9c69748a65c91212474a47fdcbd537 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sun, 22 Oct 2023 23:27:04 +0100 Subject: [PATCH] Revert ":construction_worker: Fixing naming issue with ISSUE_TEMPLATE" --- .../bug_report.yaml | 0 .../enhancement.yaml | 0 .github/workflows/cicd.yaml | 7 +- .github/workflows/release.yaml | 83 ++++++++++++++++++- requirements-dev.txt | 1 - 5 files changed, 83 insertions(+), 8 deletions(-) rename .github/{ISSUE_TEMPLATE => ISSUE_TEMPLATES}/bug_report.yaml (100%) rename .github/{ISSUE_TEMPLATE => ISSUE_TEMPLATES}/enhancement.yaml (100%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATES/bug_report.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.yaml rename to .github/ISSUE_TEMPLATES/bug_report.yaml diff --git a/.github/ISSUE_TEMPLATE/enhancement.yaml b/.github/ISSUE_TEMPLATES/enhancement.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/enhancement.yaml rename to .github/ISSUE_TEMPLATES/enhancement.yaml diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 743b076..c9359d3 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -26,9 +26,4 @@ jobs: run: flake8 . - name: ๐Ÿงช Run unit tests - run: pytest --cov - - - name: โ˜‚๏ธ Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + run: pytest # Replace with the command to run your tests \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 47cdd75..19ab247 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,4 +25,85 @@ jobs: uses: actions/upload-artifact@v3 with: name: python-package-distributions - path: dist/ \ No newline at end of file + path: dist/ + + publish-to-pypi: + name: >- + ๐Ÿš€ Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/ # Replace with your PyPI project name + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: ๐Ÿ“ฅ Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + 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@v3 + with: + name: python-package-distributions + path: dist/ + - name: โœ’๏ธ Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v1.2.3 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + - 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 }}' + + publish-to-testpypi: + name: ๐Ÿš€ Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/ + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: ๐Ÿ“ฅ Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: ๐Ÿš€ Publish distribution ๐Ÿ“ฆ to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index 3e411dd..5e96b72 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,6 +2,5 @@ rich~=13.6.0 rich-click~=1.7.0 assertpy~=1.1.0 pytest==7.4.2 -pytest-cov==4.1.0 setuptools==68.2.2 flake8~=6.1.0 \ No newline at end of file