38
38
publish_version :
39
39
description : ' Version to publish, e.g. v1.13.0'
40
40
required : true
41
+ publish_docs_only :
42
+ description : ' Build and publish docs only'
43
+ required : false
44
+ default : ' false'
41
45
42
46
jobs :
43
47
release :
@@ -51,32 +55,39 @@ jobs:
51
55
with :
52
56
python-version : " 3.8"
53
57
- name : Set release notes tag
58
+ if : ${{ github.event.inputs.publish_docs_only == "false" }}
54
59
run : |
55
60
RELEASE_TAG_VERSION=${{ github.event.release.tag_name }}
56
61
# Replace publishing version if the workflow was triggered manually
57
62
test -n ${RELEASE_TAG_VERSION} && RELEASE_TAG_VERSION=${{ github.event.inputs.publish_version }}
58
63
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
59
64
- name : Ensure new version is also set in pyproject and CHANGELOG
65
+ if : ${{ github.event.inputs.publish_docs_only == "false" }}
60
66
run : |
61
67
grep --regexp "${RELEASE_TAG_VERSION}" CHANGELOG.md
62
68
grep --regexp "version \= \"${RELEASE_TAG_VERSION}\"" pyproject.toml
63
69
- name : Install dependencies
64
70
run : make dev
65
71
- name : Run all tests, linting and baselines
72
+ if : ${{ github.event.inputs.publish_docs_only == "false" }}
66
73
run : make pr
67
74
- name : Build python package and wheel
75
+ if : ${{ github.event.inputs.publish_docs_only == "false" }}
68
76
run : poetry build
69
77
- name : Upload to PyPi test
78
+ if : ${{ github.event.inputs.publish_docs_only == "false" }}
70
79
run : make release-test
71
80
env :
72
81
PYPI_USERNAME : __token__
73
82
PYPI_TEST_TOKEN : ${{ secrets.PYPI_TEST_TOKEN }}
74
83
- name : Upload to PyPi prod
84
+ if : ${{ github.event.inputs.publish_docs_only == "false" }}
75
85
run : make release-prod
76
86
env :
77
87
PYPI_USERNAME : __token__
78
88
PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
79
89
- name : publish lambda layer in SAR by triggering the internal codepipeline
90
+ if : ${{ github.event.inputs.publish_docs_only == "false" }}
80
91
run : |
81
92
aws ssm put-parameter --name "powertools-python-release-version" --value $RELEASE_TAG_VERSION --overwrite
82
93
aws codepipeline start-pipeline-execution --name ${{ secrets.CODEPIPELINE_NAME }}
88
99
- name : Setup doc deploy
89
100
run : |
90
101
git config --global user.name Docs deploy
91
- git config --global user.email [email protected] .com
102
+ git config --global user.email aws-devax-open-source@amazon .com
92
103
- name : Build docs website and API reference
93
104
run : |
94
105
make release-docs VERSION=${RELEASE_TAG_VERSION} ALIAS="latest"
@@ -113,6 +124,7 @@ jobs:
113
124
runs-on : ubuntu-latest
114
125
steps :
115
126
- uses : actions/checkout@v2
127
+ if : ${{ github.event.inputs.publish_docs_only == "false" }}
116
128
- name : Sync master from detached head
117
129
# If version matches CHANGELOG and pyproject.toml
118
130
# If it passes all checks, successfully releases to test and prod
0 commit comments