@@ -20,6 +20,9 @@ name: Publish to PyPi
20
20
21
21
# See MAINTAINERS.md "Releasing a new version" for release mechanisms
22
22
23
+ env :
24
+ BRANCH : develop
25
+
23
26
on :
24
27
release :
25
28
types : [published]
@@ -66,16 +69,16 @@ jobs:
66
69
id : release_version
67
70
# transform tag format `v<version` to `<version`
68
71
run : |
69
- RELEASE_VERSION=${RELEASE_TAG_VERSION:1}
70
- echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
72
+ RELEASE_VERSION=" ${RELEASE_TAG_VERSION:1}"
73
+ echo "RELEASE_VERSION=${RELEASE_VERSION}" >> " $GITHUB_ENV"
71
74
echo "::set-output name=RELEASE_VERSION::${RELEASE_VERSION}"
72
75
- name : Install dependencies
73
76
run : make dev
74
77
- name : Run all tests, linting and baselines
75
78
if : ${{ !inputs.skip_code_quality }}
76
79
run : make pr
77
80
- name : Bump package version
78
- run : poetry version ${RELEASE_VERSION}
81
+ run : poetry version " ${RELEASE_VERSION}"
79
82
- name : Build python package and wheel
80
83
if : ${{ !inputs.skip_pypi }}
81
84
run : poetry build
@@ -98,61 +101,25 @@ jobs:
98
101
role-to-assume : ${{ secrets.AWS_SAR_ROLE_ARN }}
99
102
- name : publish lambda layer in SAR by triggering the internal codepipeline
100
103
run : |
101
- aws ssm put-parameter --name "powertools-python-release-version" --value $RELEASE_VERSION --overwrite
104
+ aws ssm put-parameter --name "powertools-python-release-version" --value " $RELEASE_VERSION" --overwrite
102
105
aws codepipeline start-pipeline-execution --name ${{ secrets.AWS_SAR_PIPELINE_NAME }}
103
106
104
- # NOTE: `event` type brings a detached head failing git setup
105
- # and reusable workflows only work as a standalone job
106
- # meaning we need to research for a solution that works for non-detached and detached mode
107
- # changelog:
108
- # needs: release
109
- # permissions:
110
- # contents: write
111
- # uses: ./.github/workflows/reusable_publish_changelog.yml
107
+ changelog :
108
+ needs : release
109
+ permissions :
110
+ contents : write
111
+ uses : ./.github/workflows/reusable_publish_changelog.yml
112
112
113
113
docs :
114
- needs : release
114
+ needs : [ release, changelog]
115
115
permissions :
116
116
contents : write
117
117
pages : write
118
- runs-on : ubuntu-latest
119
- env :
120
- RELEASE_VERSION : ${{ needs.release.outputs.RELEASE_VERSION }}
121
- steps :
122
- - uses : actions/checkout@v3
123
- with :
124
- fetch-depth : 0
125
- - name : Setup git client
126
- run : |
127
- git config user.name "Release bot"
128
- git config user.email [email protected]
129
- - name : Install poetry
130
- run : pipx install poetry
131
- - name : Set up Python
132
- uses : actions/setup-python@v4
133
- with :
134
- python-version : " 3.8"
135
- cache : " poetry"
136
- - name : Install dependencies
137
- run : make dev
138
- - name : Build docs website and API reference
139
- run : |
140
- make release-docs VERSION=${RELEASE_VERSION} ALIAS="latest"
141
- poetry run mike set-default --push latest
142
- - name : Release API docs to release version
143
- uses : peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0
144
- with :
145
- github_token : ${{ secrets.GITHUB_TOKEN }}
146
- publish_dir : ./api
147
- keep_files : true
148
- destination_dir : ${{ env.RELEASE_VERSION }}/api
149
- - name : Release API docs to latest
150
- uses : peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0
151
- with :
152
- github_token : ${{ secrets.GITHUB_TOKEN }}
153
- publish_dir : ./api
154
- keep_files : true
155
- destination_dir : latest/api
118
+ uses : ./.github/workflows/reusable_publish_docs.yml
119
+ with :
120
+ version : ${{ needs.release.outputs.RELEASE_VERSION }}
121
+ alias : latest
122
+ detached_mode : true
156
123
157
124
post_release :
158
125
needs : release
0 commit comments