@@ -63,20 +63,25 @@ jobs:
6363 ruby-version : 3.1
6464 - name : Validate configuration
6565 run : ruby .github/config_validator.rb "${{ matrix.config_file }}" "${{ matrix.api_version }}"
66+
6667 - name : Bump version
6768 id : bump_version
6869 run : |
6970 VERSION="${{ github.event.client_payload.version || 'patch' }}"
7071 NEW_VERSION=$(ruby .github/version.rb $VERSION ${{ matrix.config_file }})
7172 echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
73+
7274 - name : Clean repo
7375 run : ruby .github/clean.rb ${{ matrix.api_version }}
76+
7477 - name : Copy generator ignore rules
7578 run : |
7679 mkdir -p ./${{ matrix.api_version }}/
7780 cp .openapi-generator-ignore ./${{ matrix.api_version }}/
81+
7882 - name : Install openapi-generator-cli
7983 run : npm install @openapitools/openapi-generator-cli -g
84+
8085 - name : Generate SDK
8186 run : |
8287 COMMIT_SHA="${{ github.event.client_payload.commit_sha || 'master' }}"
@@ -92,11 +97,13 @@ jobs:
9297 -c ${{ matrix.config_file }} \
9398 -t ./openapi/templates \
9499 -o ./${{ matrix.api_version }}
100+
95101 - name : Upload SDK artifacts
96102 uses : actions/upload-artifact@v4
97103 with :
98104 name : generated-${{ matrix.api_version }}
99105 path : ./${{ matrix.api_version }}
106+
100107 - name : Upload config artifact
101108 uses : actions/upload-artifact@v4
102109 with :
@@ -112,6 +119,7 @@ jobs:
112119 uses : actions/download-artifact@v4
113120 with :
114121 path : ./generated
122+
115123 - name : Restore config files from artifacts
116124 run : |
117125 # Config files are bumped in the Generate job (separate runner).
@@ -126,6 +134,7 @@ jobs:
126134
127135 # Clean up config artifact directories so they don't get committed
128136 rm -rf ./generated/config-*
137+
129138 - name : Move generated files and track versions
130139 id : track_versions
131140 run : |
@@ -144,6 +153,7 @@ jobs:
144153 done
145154
146155 echo "generated_versions=$GENERATED_VERSIONS" >> $GITHUB_OUTPUT
156+
147157 - name : Update CHANGELOG
148158 run : |
149159 GENERATED_VERSIONS="${{ steps.track_versions.outputs.generated_versions }}"
@@ -158,6 +168,7 @@ jobs:
158168 # Trim leading/trailing whitespace first
159169 VERSIONS_CSV=$(echo "$GENERATED_VERSIONS" | xargs | tr ' ' ',')
160170 ruby .github/changelog_manager.rb "$VERSIONS_CSV"
171+
161172 - name : Copy documentation
162173 run : |
163174 GENERATED_VERSIONS="${{ steps.track_versions.outputs.generated_versions }}"
@@ -167,6 +178,7 @@ jobs:
167178 cp CHANGELOG.md "./$VERSION/CHANGELOG.md"
168179 cp MIGRATION.md "./$VERSION/MIGRATION.md"
169180 done
181+
170182 - name : Checkout master
171183 run : git checkout master
172184 - name : Create commit
@@ -181,3 +193,31 @@ jobs:
181193 run : git push origin master
182194 env :
183195 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
196+
197+ # GitHub security feature: pushes using GITHUB_TOKEN don't trigger other workflows.
198+ # We must explicitly trigger on-push-master.yml using a GitHub App token.
199+ - name : Generate access token
200+ id : generate_token
201+ uses : tibdex/github-app-token@v1
202+ with :
203+ app_id : ${{ secrets.PAPI_SDK_APP_ID }}
204+ installation_id : ${{ secrets.PAPI_SDK_INSTALLATION_ID }}
205+ private_key : ${{ secrets.PAPI_SDK_PRIVATE_KEY }}
206+
207+ - name : Trigger publish and release workflow
208+ uses : peter-evans/repository-dispatch@v2
209+ with :
210+ token : ${{ steps.generate_token.outputs.token }}
211+ event-type : manual_push_to_master
212+
213+ - name : Slack notification
214+ uses : ravsamhq/notify-slack-action@v2
215+ if : always()
216+ with :
217+ status : ${{ job.status }}
218+ token : ${{ secrets.GITHUB_TOKEN }}
219+ notification_title : " {repo}: {workflow} workflow"
220+ message_format : " {emoji} *<{workflow_url}|{workflow}>* {status_message} in <{repo_url}|{repo}>"
221+ notify_when : " failure"
222+ env :
223+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments