@@ -33,23 +33,12 @@ name: Publish to PyPi
3333#
3434# === Documentation hotfix ===
3535#
36- # 1. Trigger "Publish to PyPi" workflow manually: https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
37- # 2. Use the latest version released under Releases e.g. v1.21.1
38- # 3. Set `Build and publish docs only` field to `true`
36+ # Look for rebuild latest docs workflow
3937
4038
4139on :
4240 release :
4341 types : [published]
44- workflow_dispatch :
45- inputs :
46- publish_version :
47- description : ' Version to publish, e.g. v1.13.0'
48- required : true
49- publish_docs_only :
50- description : ' Build and publish docs only'
51- required : false
52- default : ' false'
5342
5443jobs :
5544 release :
@@ -65,40 +54,33 @@ jobs:
6554 - name : Set release notes tag
6655 run : |
6756 RELEASE_TAG_VERSION=${{ github.event.release.tag_name }}
68- # Replace publishing version if the workflow was triggered manually
69- # test -n ${RELEASE_TAG_VERSION} && RELEASE_TAG_VERSION=${{ github.event.inputs.publish_version }}
7057 echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
7158 - name : Ensure new version is also set in pyproject and CHANGELOG
72- if : ${{ github.event.inputs.publish_docs_only == false }}
7359 run : |
7460 grep --regexp "${RELEASE_TAG_VERSION}" CHANGELOG.md
7561 grep --regexp "version \= \"${RELEASE_TAG_VERSION}\"" pyproject.toml
7662 - name : Install dependencies
7763 run : make dev
7864 - name : Run all tests, linting and baselines
79- if : ${{ github.event.inputs.publish_docs_only == false }}
8065 run : make pr
8166 - name : Build python package and wheel
82- if : ${{ github.event.inputs.publish_docs_only == false }}
8367 run : poetry build
8468 - name : Upload to PyPi test
85- if : ${{ github.event.inputs.publish_docs_only == false }}
8669 run : make release-test
8770 env :
8871 PYPI_USERNAME : __token__
8972 PYPI_TEST_TOKEN : ${{ secrets.PYPI_TEST_TOKEN }}
9073 - name : Upload to PyPi prod
91- if : ${{ github.event.inputs.publish_docs_only == false }}
9274 run : make release-prod
9375 env :
9476 PYPI_USERNAME : __token__
9577 PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
9678 - name : publish lambda layer in SAR by triggering the internal codepipeline
97- if : ${{ github.event.inputs.publish_docs_only == false }}
9879 run : |
9980 aws ssm put-parameter --name "powertools-python-release-version" --value $RELEASE_TAG_VERSION --overwrite
10081 aws codepipeline start-pipeline-execution --name ${{ secrets.CODEPIPELINE_NAME }}
10182 env :
83+ # Maintenance: Migrate to new OAuth mechanism
10284 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
10385 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
10486 AWS_DEFAULT_REGION : eu-west-1
@@ -129,7 +111,6 @@ jobs:
129111 sync_master :
130112 needs : release
131113 runs-on : ubuntu-latest
132- if : ${{ github.event.inputs.publish_docs_only == false }}
133114 steps :
134115 - uses : actions/checkout@v2
135116 - name : Sync master from detached head
0 commit comments