From f8f1f4fa54ef5b818698de2299db31f2628ac97f Mon Sep 17 00:00:00 2001 From: Modeseven Industrial Solutions Date: Thu, 8 Aug 2024 15:54:13 +0100 Subject: [PATCH] Chore: Bump version, disable legacy workflows (#53) Signed-off-by: Matthew Watkins --- .github/workflows/release.yaml | 174 ---------------------------- .github/workflows/repository.yaml | 4 - .github/workflows/test-release.yaml | 152 ------------------------ pyproject.toml | 2 +- 4 files changed, 1 insertion(+), 331 deletions(-) delete mode 100644 .github/workflows/release.yaml delete mode 100644 .github/workflows/test-release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 6fe13e0..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,174 +0,0 @@ ---- -name: "🐍📦 Old Production build and release" - -# GitHub/PyPI trusted publisher documentation: -# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ - -# yamllint disable-line rule:truthy -on: - push: - # Only invoked on release tag pushes - tags: - - 'v*.*.*' - -env: - python-version: "3.10" - -### BUILD ### - -jobs: - - build: - name: "🐍 Build packages" - # Only publish on tag pushes - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - permissions: - contents: write - id-token: write - - steps: - ### BUILDING ### - - - name: "Checkout repository" - uses: actions/checkout@v4 - - - name: "Setup Python" - uses: actions/setup-python@v5 - with: - python-version: ${{ env.python-version }} - - - name: "Setup PDM for build commands" - uses: pdm-project/setup-pdm@v4 - - - name: "Fetch current semantic tag" - id: fetch-tags - # yamllint disable-line rule:line-length - uses: os-climate/devops-reusable-workflows/.github/actions/latest-semantic-tag@main - - - name: "Update version from tags for production release" - run: | - echo "Github tag/versioning: ${{ github.ref_name }}" - if (grep 'dynamic = \[\"version\"\]' pyproject.toml > /dev/null); then - echo "Proceeding build with dynamic versioning" - else - echo "Using legacy script to bump release version" - scripts/release-versioning.sh - fi - - - name: "Build with PDM backend" - run: | - pdm build - - ### SIGNING ### - - - name: "Sign packages with Sigstore" - # Use new action - uses: sigstore/gh-action-sigstore-python@v3.0.0 - with: - inputs: >- - ./dist/*.tar.gz - ./dist/*.whl - - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: ${{ github.ref_name }} - path: dist/ - - ### PUBLISH GITHUB ### - - github: - name: "📦 Publish to GitHub" - needs: - - build - runs-on: ubuntu-latest - permissions: - # IMPORTANT: mandatory to publish artefacts - contents: write - steps: - - name: "⬇ Download build artefacts" - uses: actions/download-artifact@v4 - with: - name: ${{ github.ref_name }} - path: dist/ - - - name: "📦 Publish artefacts to GitHub" - # https://github.com/softprops/action-gh-release - uses: softprops/action-gh-release@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - prerelease: false - tag_name: ${{ github.ref_name }} - name: ${{ github.ref_name }}" - # body_path: ${{ github.workspace }}/CHANGELOG.rst - files: | - dist/*.tar.gz - dist/*.whl - dist/*.sigstore* - - ### PUBLISH PYPI TEST ### - - testpypi: - name: "📦 Test publishing to PyPI" - needs: - - build - runs-on: ubuntu-latest - environment: - name: testpypi - permissions: - # IMPORTANT: mandatory for trusted publishing - id-token: write - steps: - - name: "⬇ Download build artefacts" - uses: actions/download-artifact@v4 - with: - name: ${{ github.ref_name }} - path: dist/ - - - name: "Remove files unsupported by PyPi" - run: | - if [ -f dist/buildvars.txt ]; then - rm dist/buildvars.txt - fi - rm dist/*.sigstore* - - - name: "Test publishing to PyPI" - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - verbose: true - - ### PUBLISH PYPI ### - - pypi: - name: "📦 Publish to PyPi" - needs: - - testpypi - runs-on: ubuntu-latest - environment: - name: pypi - permissions: - # IMPORTANT: mandatory for trusted publishing - id-token: write - steps: - - name: "⬇ Download build artefacts" - uses: actions/download-artifact@v4 - with: - name: ${{ github.ref_name }} - path: dist/ - - - name: "Remove files unsupported by PyPi" - run: | - if [ -f dist/buildvars.txt ]; then - rm dist/buildvars.txt - fi - rm dist/*.sigstore* - - - name: "Setup PDM for build commands" - uses: pdm-project/setup-pdm@v4 - - - name: "Publish release to PyPI" - uses: pypa/gh-action-pypi-publish@release/v1 - with: - verbose: true diff --git a/.github/workflows/repository.yaml b/.github/workflows/repository.yaml index 9983326..936934c 100644 --- a/.github/workflows/repository.yaml +++ b/.github/workflows/repository.yaml @@ -295,10 +295,6 @@ jobs: pypi: name: "Publish Package" # Only publish on tag pushes - if: - # startsWith(github.ref, 'refs/tags/') && - needs.python-build.outputs.publish == 'true' - # contains(github.event.head_commit.message, '[release]') needs: [python-build, github-workflow-metadata, testpypi] runs-on: ubuntu-latest environment: diff --git a/.github/workflows/test-release.yaml b/.github/workflows/test-release.yaml deleted file mode 100644 index bafecb4..0000000 --- a/.github/workflows/test-release.yaml +++ /dev/null @@ -1,152 +0,0 @@ ---- -name: "🐍📦 Test build and release" - -# GitHub/PyPI trusted publisher documentation: -# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ - -# yamllint disable-line rule:truthy -on: - workflow_dispatch: - -env: - python-version: "3.10" - -### BUILD ### - -jobs: - build: - name: "🐍 Build packages" - runs-on: ubuntu-latest - permissions: - # IMPORTANT: mandatory for Sigstore - id-token: write - steps: - ### BUILDING ### - - - name: "Checkout repository" - uses: actions/checkout@v4 - - - name: "Setup Python 3.10" - uses: actions/setup-python@v5 - with: - python-version: ${{ env.python-version }} - - - name: "Setup PDM for build commands" - uses: pdm-project/setup-pdm@v4 - with: - python-version: ${{ env.python-version }} - - - name: "Populate environment variables" - id: setenv - run: | - vernum="${{ env.python-version }}.$(date +'%Y%m%d%H%M')" - echo "vernum=${vernum}" >> "$GITHUB_OUTPUT" - echo "vernum=${vernum}" >> buildvars.txt - - - name: "Tag for test release" - # Delete all local tags, then create a synthetic tag for testing - # Use the date/time to avoid conflicts uploading to Test PyPI - run: | - scripts/dev-versioning.sh "${{ steps.setenv.outputs.vernum }}" - git tag | xargs -L 1 | xargs git tag --delete - git tag "v${{ steps.setenv.outputs.vernum }}" - git checkout "tags/v${{ steps.setenv.outputs.vernum }}" - grep version pyproject.toml - - - name: "Build with PDM backend" - run: | - pdm build - # Need to save the build environment for subsequent steps - mv buildvars.txt dist/buildvars.txt - - ### SIGNING ### - - - name: "Sign packages with Sigstore" - uses: sigstore/gh-action-sigstore-python@v2 - - with: - inputs: >- - ./dist/*.tar.gz - ./dist/*.whl - - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: Development - path: dist/ - - ### PUBLISH GITHUB ### - - github: - name: "📦 Test publish to GitHub" - needs: - - build - runs-on: ubuntu-latest - permissions: - # IMPORTANT: mandatory to publish artefacts - contents: write - steps: - - name: "⬇ Download build artefacts" - uses: actions/download-artifact@v4 - with: - name: Development - path: dist/ - - - name: "Source environment variables" - id: setenv - run: | - if [ -f dist/buildvars.txt ]; then - source dist/buildvars.txt - echo "vernum=${vernum}" >> "$GITHUB_OUTPUT" - else - echo "Build environment variables could not be sourced" - fi - echo "tarball=$(ls dist/*.tgz)" >> "$GITHUB_OUTPUT" - echo "wheel=$(ls dist/*.whl)" >> "$GITHUB_OUTPUT" - - - name: "📦 Publish artefacts to GitHub" - # https://github.com/softprops/action-gh-release - uses: softprops/action-gh-release@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - prerelease: true - tag_name: ${{ steps.setenv.outputs.vernum }} - name: "Test/Development Build \ - ${{ steps.setenv.outputs.vernum }}" - # body_path: ${{ github.workspace }}/CHANGELOG.rst - files: | - dist/*.tar.gz - dist/*.whl - dist/*.sigstore - - ### PUBLISH TEST PYPI ### - - testpypi: - name: "📦 Test publish to PyPi" - needs: - - build - runs-on: ubuntu-latest - environment: - name: testpypi - permissions: - # IMPORTANT: mandatory for trusted publishing - id-token: write - steps: - - name: "⬇ Download build artefacts" - uses: actions/download-artifact@v4 - with: - name: Development - path: dist/ - - - name: "Remove files unsupported by PyPi" - run: | - if [ -f dist/buildvars.txt ]; then - rm dist/buildvars.txt - fi - rm dist/*.sigstore - - - name: Publish distribution to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - verbose: true - repository-url: https://test.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index 5f2e2c1..f0695d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "osc-transformer-based-extractor" -version = "0.1.1" +version = "0.1.2" description = "OS-Climate Data Extraction Tool" authors = [ {name = "Tanishq More", email = "tanishq.more@investmentdataservices.com"},