Skip to content

Commit 5ced73c

Browse files
committed
chore: conditional to publish docs only
1 parent f71461c commit 5ced73c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/publish.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ on:
3838
publish_version:
3939
description: 'Version to publish, e.g. v1.13.0'
4040
required: true
41+
publish_docs_only:
42+
description: 'Build and publish docs only'
43+
required: false
44+
default: 'false'
4145

4246
jobs:
4347
release:
@@ -51,32 +55,39 @@ jobs:
5155
with:
5256
python-version: "3.8"
5357
- name: Set release notes tag
58+
if: ${{ github.event.inputs.publish_docs_only == "false" }}
5459
run: |
5560
RELEASE_TAG_VERSION=${{ github.event.release.tag_name }}
5661
# Replace publishing version if the workflow was triggered manually
5762
test -n ${RELEASE_TAG_VERSION} && RELEASE_TAG_VERSION=${{ github.event.inputs.publish_version }}
5863
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
5964
- name: Ensure new version is also set in pyproject and CHANGELOG
65+
if: ${{ github.event.inputs.publish_docs_only == "false" }}
6066
run: |
6167
grep --regexp "${RELEASE_TAG_VERSION}" CHANGELOG.md
6268
grep --regexp "version \= \"${RELEASE_TAG_VERSION}\"" pyproject.toml
6369
- name: Install dependencies
6470
run: make dev
6571
- name: Run all tests, linting and baselines
72+
if: ${{ github.event.inputs.publish_docs_only == "false" }}
6673
run: make pr
6774
- name: Build python package and wheel
75+
if: ${{ github.event.inputs.publish_docs_only == "false" }}
6876
run: poetry build
6977
- name: Upload to PyPi test
78+
if: ${{ github.event.inputs.publish_docs_only == "false" }}
7079
run: make release-test
7180
env:
7281
PYPI_USERNAME: __token__
7382
PYPI_TEST_TOKEN: ${{ secrets.PYPI_TEST_TOKEN }}
7483
- name: Upload to PyPi prod
84+
if: ${{ github.event.inputs.publish_docs_only == "false" }}
7585
run: make release-prod
7686
env:
7787
PYPI_USERNAME: __token__
7888
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
7989
- name: publish lambda layer in SAR by triggering the internal codepipeline
90+
if: ${{ github.event.inputs.publish_docs_only == "false" }}
8091
run: |
8192
aws ssm put-parameter --name "powertools-python-release-version" --value $RELEASE_TAG_VERSION --overwrite
8293
aws codepipeline start-pipeline-execution --name ${{ secrets.CODEPIPELINE_NAME }}
@@ -88,7 +99,7 @@ jobs:
8899
- name: Setup doc deploy
89100
run: |
90101
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
92103
- name: Build docs website and API reference
93104
run: |
94105
make release-docs VERSION=${RELEASE_TAG_VERSION} ALIAS="latest"
@@ -113,6 +124,7 @@ jobs:
113124
runs-on: ubuntu-latest
114125
steps:
115126
- uses: actions/checkout@v2
127+
if: ${{ github.event.inputs.publish_docs_only == "false" }}
116128
- name: Sync master from detached head
117129
# If version matches CHANGELOG and pyproject.toml
118130
# If it passes all checks, successfully releases to test and prod

0 commit comments

Comments
 (0)