File tree 3 files changed +31
-13
lines changed
3 files changed +31
-13
lines changed Original file line number Diff line number Diff line change
1
+ # Standalone workflow to update changelog if necessary
2
+ name : Build changelog
3
+
4
+ on :
5
+ workflow_dispatch :
6
+
7
+ jobs :
8
+ changelog :
9
+ needs : release
10
+ uses : ./.github/workflows/reusable_publish_changelog.yml
Original file line number Diff line number Diff line change @@ -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]
@@ -101,17 +104,14 @@ jobs:
101
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
@@ -122,10 +122,13 @@ jobs:
122
122
- uses : actions/checkout@v3
123
123
with :
124
124
fetch-depth : 0
125
- - name : Setup git client
125
+ - name : Git client setup and refresh tip
126
126
run : |
127
127
git config user.name "Release bot"
128
- git config user.email aws-devax-open-source@amazon.com
128
+ git config user.email "aws-devax-open-source@amazon.com"
129
+ git config pull.rebase true
130
+ git config remote.origin.url >&- || git remote add origin https://github.com/$origin # Git Detached mode (release notes) doesn't have origin
131
+ git pull origin $BRANCH
129
132
- name : Install poetry
130
133
run : pipx install poetry
131
134
- name : Set up Python
Original file line number Diff line number Diff line change 6
6
permissions :
7
7
contents : write
8
8
9
+ env :
10
+ BRANCH : develop
11
+
9
12
jobs :
10
13
publish_changelog :
11
14
# Force Github action to run only a single job at a time (based on the group name)
@@ -23,11 +26,13 @@ jobs:
23
26
git config user.name "Release bot"
24
27
git config user.email "aws-devax-open-source@amazon.com"
25
28
git config pull.rebase true
26
- git pull --rebase
29
+ git config remote.origin.url >&- || git remote add origin https://github.com/$origin # Git Detached mode (release notes) doesn't have origin
30
+ git pull origin $BRANCH
27
31
- name : " Generate latest changelog"
28
32
run : make changelog
29
33
- name : Update Changelog in trunk
30
34
run : |
31
35
git add CHANGELOG.md
32
36
git commit -m "update changelog with latest changes"
33
- git push origin HEAD:refs/heads/develop
37
+ git pull origin $BRANCH # prevents concurrent branch update failing push
38
+ git push origin HEAD:refs/heads/$BRANCH
You can’t perform that action at this time.
0 commit comments