From 86296acf52dc753b0e7da32794f9fec902907f49 Mon Sep 17 00:00:00 2001 From: ejirolaureld Date: Fri, 8 Mar 2024 19:06:32 +0100 Subject: [PATCH 01/10] inhibit releases when no changes on code base --- .github/workflows/inhibit-release.yml | 90 +++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/inhibit-release.yml diff --git a/.github/workflows/inhibit-release.yml b/.github/workflows/inhibit-release.yml new file mode 100644 index 0000000000..a5a2cb579b --- /dev/null +++ b/.github/workflows/inhibit-release.yml @@ -0,0 +1,90 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Inhibit autorelease without core code changes + +on: + push: + branches: [ main ] # Or your designated branch + + schedule: + - cron: '42 22 * * MON' # Run every Monday at 22:42 + + workflow_dispatch: + inputs: + suffix: + description: 'Release Suffix to append to version info. For eg. devN, a0' + required: false + default: '' + + permissions: + contents: write + +jobs: + + deploy: + deploy: + # This action is intended to be invoked manually for debugging purposes + if : github.actor == 'yadudoc' || github.actor == 'benclifford' + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Check if release is warranted + uses: gr2m/release-check@v1.7.0 # Replace with latest version if needed + with: + protected-paths: '**/*.py' # Adjust paths as needed + + - name: Set up Python + uses: actions/setup-python@v4 + with: + # The release process needs distutils - see Parsl issue #2934 # which was removed from Python 3.12 + python-version: '3.11' + + - name: Set version info (optional) + id: version_setter + run: echo "VERSION=$(date +'%Y.%m.%d')$SUFFIX" >> $GITHUB_OUTPUT + env: + SUFFIX: ${{ github.event.inputs.suffix }} # Assuming suffix is an input + + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel + pip install build + + - name: Build package + run: | + ./tag_and_release.sh update_version + ./tag_and_release.sh package + env: + VERSION: ${{ steps.version_setter.outputs.VERSION }} + + - name: Publish package (if release is warranted) + run: | + if [[ ${{ steps.release_check.outputs.proceed }} == "true" ]]; then + # Your existing publish package step + echo "Publishing package..." + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + fi + + - name: Mint a tag (if release is warranted) + run: | + if [[ ${{ steps.release_check.outputs.proceed }} == "true" ]]; then + # Your existing mint tag step + echo "Minting tag..." + uses: rickstaa/action-create-tag@v1 + with: + tag: ${{ steps.version_setter.outputs.VERSION }} + message: "Release version: ${{ steps.version_setter.outputs.VERSION }}" + fi + From 6bb82b1c1c85dd6e504d136265b08cca8d883ff4 Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:08:23 +0100 Subject: [PATCH 02/10] Update inhibit-release.yml --- .github/workflows/inhibit-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/inhibit-release.yml b/.github/workflows/inhibit-release.yml index a5a2cb579b..d7cff9c137 100644 --- a/.github/workflows/inhibit-release.yml +++ b/.github/workflows/inhibit-release.yml @@ -10,7 +10,7 @@ name: Inhibit autorelease without core code changes on: push: - branches: [ main ] # Or your designated branch + branches: [ releases ] # Or your designated branch schedule: - cron: '42 22 * * MON' # Run every Monday at 22:42 From 8304ee0f6d9d2a40e0f358b8d48a6bb76ee041b9 Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:22:12 +0100 Subject: [PATCH 03/10] Update inhibit-release.yml --- .github/workflows/inhibit-release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/inhibit-release.yml b/.github/workflows/inhibit-release.yml index d7cff9c137..d4f79f0596 100644 --- a/.github/workflows/inhibit-release.yml +++ b/.github/workflows/inhibit-release.yml @@ -22,9 +22,6 @@ on: required: false default: '' - permissions: - contents: write - jobs: deploy: From 71e17a47d0f8439066544e878e7326fdd202e07b Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:23:44 +0100 Subject: [PATCH 04/10] Update inhibit-release.yml --- .github/workflows/inhibit-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/inhibit-release.yml b/.github/workflows/inhibit-release.yml index d4f79f0596..ffeabdbcf9 100644 --- a/.github/workflows/inhibit-release.yml +++ b/.github/workflows/inhibit-release.yml @@ -23,8 +23,6 @@ on: default: '' jobs: - - deploy: deploy: # This action is intended to be invoked manually for debugging purposes if : github.actor == 'yadudoc' || github.actor == 'benclifford' From 2e10b560eda2fc9e125320a8fd419f152c49f133 Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:27:31 +0100 Subject: [PATCH 05/10] Update inhibit-release.yml --- .github/workflows/inhibit-release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/inhibit-release.yml b/.github/workflows/inhibit-release.yml index ffeabdbcf9..1bb343e221 100644 --- a/.github/workflows/inhibit-release.yml +++ b/.github/workflows/inhibit-release.yml @@ -24,9 +24,6 @@ on: jobs: deploy: - # This action is intended to be invoked manually for debugging purposes - if : github.actor == 'yadudoc' || github.actor == 'benclifford' - runs-on: ubuntu-latest steps: From b5e1946b71b1bc9f4f47ab811a892f426ede193c Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 12 Mar 2024 12:31:52 +0100 Subject: [PATCH 06/10] Create check.yml --- .github/workflows/check.yml | 79 +++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000000..60fda7b854 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,79 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + push: + branches: [releases] + + workflow_dispatch: + inputs: + suffix: + description: 'Release Suffix to append to version info. For eg. devN, a0' + required: false + default: '' + +permissions: + contents: write + +jobs: + + deploy: + # This action is intended to be invoked manually for debugging purposes + if : github.actor == 'yadudoc' || github.actor == 'benclifford' + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Check if this commit is already released + id: already_released + run: | + if git tag --contains HEAD | grep -e '^[0-9]\{4\}\.[0-9]\{2\}\.[0-9]\{2\}$' ; then exit 1 ; fi + + - name: Set up Python + uses: actions/setup-python@v4 + with: + # The release process needs distutils - see Parsl issue #2934 + # which was removed from Python 3.12 + python-version: '3.11' + + - name: Set version info + id: version_setter + run: echo "VERSION=$(date +'%Y.%m.%d')$SUFFIX" >> $GITHUB_OUTPUT + env: + SUFFIX: ${{ inputs.suffix }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel + pip install build + - name: Build package + run: | + ./tag_and_release.sh update_version + ./tag_and_release.sh package + env: + VERSION: ${{ steps.version_setter.outputs.VERSION }} + + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + # Set the following to publish to TestPypi instead + # password: ${{ secrets.TESTPYPI_API_TOKEN }} + # repository_url: https://test.pypi.org/legacy/ + + password: ${{ secrets.PYPI_API_TOKEN }} + + - name: Mint a tag + uses: rickstaa/action-create-tag@v1 + with: + tag: ${{ steps.version_setter.outputs.VERSION }} + message: "Release version: ${{ steps.version_setter.outputs.VERSION }}" From 5192e00a835a8b9d295e03dbbaa5d044077ce8f6 Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:01:45 +0100 Subject: [PATCH 07/10] Update check.yml --- .github/workflows/check.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 60fda7b854..a394f727d0 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -23,11 +23,7 @@ permissions: contents: write jobs: - deploy: - # This action is intended to be invoked manually for debugging purposes - if : github.actor == 'yadudoc' || github.actor == 'benclifford' - runs-on: ubuntu-latest steps: From b3cc81168dc60eecce808ccb5a26070ff7de11cb Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:02:46 +0100 Subject: [PATCH 08/10] Update python-publish-to-testpypi.yml --- .github/workflows/python-publish-to-testpypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish-to-testpypi.yml b/.github/workflows/python-publish-to-testpypi.yml index 4bd7489af9..dc4f374302 100644 --- a/.github/workflows/python-publish-to-testpypi.yml +++ b/.github/workflows/python-publish-to-testpypi.yml @@ -10,7 +10,7 @@ name: Upload Python Package on: schedule: - - cron: '42 22 * * MON' # Run every Monday at 22:42 + - cron: '* * * * MON' # Run every Monday at 22:42 workflow_dispatch: inputs: From 9fe87fa49fe7ed676196d38c9962b5e73ffb4de9 Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:40:12 +0100 Subject: [PATCH 09/10] Update python-publish-to-testpypi.yml --- .github/workflows/python-publish-to-testpypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish-to-testpypi.yml b/.github/workflows/python-publish-to-testpypi.yml index dc4f374302..4bd7489af9 100644 --- a/.github/workflows/python-publish-to-testpypi.yml +++ b/.github/workflows/python-publish-to-testpypi.yml @@ -10,7 +10,7 @@ name: Upload Python Package on: schedule: - - cron: '* * * * MON' # Run every Monday at 22:42 + - cron: '42 22 * * MON' # Run every Monday at 22:42 workflow_dispatch: inputs: From c0cf29e5dea64d91554c610cbcb923377043461a Mon Sep 17 00:00:00 2001 From: Ejiroghene Laurel Dafe <99752279+EjiroLaurelD@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:43:02 +0100 Subject: [PATCH 10/10] Create testci.yml --- .github/workflows/testci.yml | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/testci.yml diff --git a/.github/workflows/testci.yml b/.github/workflows/testci.yml new file mode 100644 index 0000000000..6e4a55e159 --- /dev/null +++ b/.github/workflows/testci.yml @@ -0,0 +1,61 @@ +name: Upload Python Package + +on: + push: + branches: + - releases # Run the job on pushes to the releases branch + schedule: + - cron: '* * * * MON' # Run every Monday at 22:42 + workflow_dispatch: + inputs: + suffix: + description: 'Release Suffix to append to version info. For eg. devN, a0' + required: false + default: '' + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Check if this commit is already released + id: already_released + run: | + if git tag --contains HEAD | grep -e '^[0-9]\{4\}\.[0-9]\{2\}\.[0-9]\{2\}$' ; then exit 1 ; fi + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Set version info + id: version_setter + run: echo "VERSION=$(date +'%Y.%m.%d')$SUFFIX" >> $GITHUB_OUTPUT + env: + SUFFIX: ${{ inputs.suffix }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel + pip install build + + - name: Build package + run: | + ./tag_and_release.sh update_version + ./tag_and_release.sh package + env: + VERSION: ${{ steps.version_setter.outputs.VERSION }} + + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + + - name: Mint a tag + uses: rickstaa/action-create-tag@v1 + with: + tag: ${{ steps.version_setter.outputs.VERSION }} + message: "Release version: ${{ steps.version_setter.outputs.VERSION }}"