Skip to content

Commit 7405c84

Browse files
Merge pull request #655 from codatio/feat/CONN-1273-release-stubs
CONN-1273: replace Speakeasy generate/release workflows with thin stubs
2 parents 2348452 + 7ed8919 commit 7405c84

10 files changed

Lines changed: 265 additions & 90 deletions
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Generation no longer runs in this repo: generate-and-pr.yml in Codat SDK
3+
# Codegen generates this SDK and opens a versioned PR here, dispatched by the
4+
# oas pipeline. This stub only says so.
15
name: Generate Bank Feeds library
26
'on':
37
workflow_dispatch:
@@ -11,15 +15,12 @@ name: Generate Bank Feeds library
1115
type: string
1216
jobs:
1317
generate:
14-
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
15-
with:
16-
mode: pr
17-
speakeasy_version: latest
18-
force: ${{ github.event.inputs.force }}
19-
set_version: ${{ github.event.inputs.set_version }}
20-
target: bank-feeds-library
21-
secrets:
22-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
23-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
24-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
25-
pypi_token: ${{ secrets.PYPI_TOKEN }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Generation moved to Codat SDK Codegen
21+
run: |
22+
echo "::warning::This workflow no longer generates anything. bank-feeds is generated by generate-and-pr.yml in Codat SDK Codegen, dispatched by the oas pipeline, which opens a versioned PR on this repo."
23+
# Exits 0 because the oas pipeline still runs this workflow on every OAS
24+
# merge; flip to exit 1 in the same change that switches the oas trigger
25+
# to the repository dispatch, so stray runs become loud.
26+
exit 0
Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,49 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Publishing no longer runs in this repo. The packaging checks, the PyPI upload,
3+
# the tag and the GitHub release all run centrally in publish-python.yml in
4+
# Codat SDK Codegen - no check has been dropped, they just moved. This stub
5+
# only forwards the release trigger there, authenticated with a short-lived
6+
# token minted from the GitHub App in the PUBLISH_TRIGGER_APP_* secrets.
7+
#
8+
# Set the PUBLISH_PRERELEASE Actions variable on this repo to rc1 to make the
9+
# next merge publish <version>rc1 rather than <version>. A plain
10+
# `pip install` skips pre-releases, so only people who ask for the rc by name
11+
# get it. Clear the variable once the real version has been promoted.
112
name: Release Bank Feeds library
213
'on':
314
push:
415
paths:
516
- bank-feeds/RELEASES.md
617
branches:
718
- main
19+
workflow_dispatch: {}
20+
concurrency: publish-bank-feeds-python
821
jobs:
922
publish:
10-
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
11-
secrets:
12-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
13-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
14-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
15-
pypi_token: ${{ secrets.PYPI_TOKEN }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check the App secrets are set
26+
env:
27+
APP_ID_SET: ${{ secrets.PUBLISH_TRIGGER_APP_ID != '' }}
28+
APP_KEY_SET: ${{ secrets.PUBLISH_TRIGGER_APP_PRIVATE_KEY != '' }}
29+
run: |
30+
if [ "$APP_ID_SET" != "true" ] || [ "$APP_KEY_SET" != "true" ]; then
31+
echo "::error::PUBLISH_TRIGGER_APP_ID / PUBLISH_TRIGGER_APP_PRIVATE_KEY secrets are not set - needed to mint the token that sends the publish-python repository dispatch to codat-internal/sdk-codegen"
32+
exit 1
33+
fi
34+
- name: Mint a token from the GitHub App
35+
id: app_token
36+
uses: actions/create-github-app-token@v2
37+
with:
38+
app-id: ${{ secrets.PUBLISH_TRIGGER_APP_ID }}
39+
private-key: ${{ secrets.PUBLISH_TRIGGER_APP_PRIVATE_KEY }}
40+
owner: codat-internal
41+
repositories: sdk-codegen
42+
- name: Hand the release to the central publish pipeline
43+
run: |
44+
curl --fail-with-body --silent --show-error -X POST \
45+
-H "Accept: application/vnd.github+json" \
46+
-H "Authorization: Bearer ${{ steps.app_token.outputs.token }}" \
47+
https://api.github.com/repos/codat-internal/sdk-codegen/dispatches \
48+
-d '{"event_type": "publish-python", "client_payload": {"product": "bank-feeds", "sha": "${{ github.sha }}", "sdk_repo": "${{ github.repository }}", "prerelease": "${{ vars.PUBLISH_PRERELEASE }}"}}'
49+
echo "publish-python dispatch sent to codat-internal/sdk-codegen for bank-feeds @ ${{ github.sha }}${{ vars.PUBLISH_PRERELEASE && format(' as a {0} pre-release', vars.PUBLISH_PRERELEASE) || '' }}"
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Generation no longer runs in this repo: generate-and-pr.yml in Codat SDK
3+
# Codegen generates this SDK and opens a versioned PR here, dispatched by the
4+
# oas pipeline. This stub only says so.
15
name: Generate Lending library
26
'on':
37
workflow_dispatch:
@@ -11,15 +15,12 @@ name: Generate Lending library
1115
type: string
1216
jobs:
1317
generate:
14-
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
15-
with:
16-
mode: pr
17-
speakeasy_version: latest
18-
force: ${{ github.event.inputs.force }}
19-
set_version: ${{ github.event.inputs.set_version }}
20-
target: lending-library
21-
secrets:
22-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
23-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
24-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
25-
pypi_token: ${{ secrets.PYPI_TOKEN }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Generation moved to Codat SDK Codegen
21+
run: |
22+
echo "::warning::This workflow no longer generates anything. lending is generated by generate-and-pr.yml in Codat SDK Codegen, dispatched by the oas pipeline, which opens a versioned PR on this repo."
23+
# Exits 0 because the oas pipeline still runs this workflow on every OAS
24+
# merge; flip to exit 1 in the same change that switches the oas trigger
25+
# to the repository dispatch, so stray runs become loud.
26+
exit 0
Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,49 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Publishing no longer runs in this repo. The packaging checks, the PyPI upload,
3+
# the tag and the GitHub release all run centrally in publish-python.yml in
4+
# Codat SDK Codegen - no check has been dropped, they just moved. This stub
5+
# only forwards the release trigger there, authenticated with a short-lived
6+
# token minted from the GitHub App in the PUBLISH_TRIGGER_APP_* secrets.
7+
#
8+
# Set the PUBLISH_PRERELEASE Actions variable on this repo to rc1 to make the
9+
# next merge publish <version>rc1 rather than <version>. A plain
10+
# `pip install` skips pre-releases, so only people who ask for the rc by name
11+
# get it. Clear the variable once the real version has been promoted.
112
name: Release Lending library
213
'on':
314
push:
415
paths:
516
- lending/RELEASES.md
617
branches:
718
- main
19+
workflow_dispatch: {}
20+
concurrency: publish-lending-python
821
jobs:
922
publish:
10-
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
11-
secrets:
12-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
13-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
14-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
15-
pypi_token: ${{ secrets.PYPI_TOKEN }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check the App secrets are set
26+
env:
27+
APP_ID_SET: ${{ secrets.PUBLISH_TRIGGER_APP_ID != '' }}
28+
APP_KEY_SET: ${{ secrets.PUBLISH_TRIGGER_APP_PRIVATE_KEY != '' }}
29+
run: |
30+
if [ "$APP_ID_SET" != "true" ] || [ "$APP_KEY_SET" != "true" ]; then
31+
echo "::error::PUBLISH_TRIGGER_APP_ID / PUBLISH_TRIGGER_APP_PRIVATE_KEY secrets are not set - needed to mint the token that sends the publish-python repository dispatch to codat-internal/sdk-codegen"
32+
exit 1
33+
fi
34+
- name: Mint a token from the GitHub App
35+
id: app_token
36+
uses: actions/create-github-app-token@v2
37+
with:
38+
app-id: ${{ secrets.PUBLISH_TRIGGER_APP_ID }}
39+
private-key: ${{ secrets.PUBLISH_TRIGGER_APP_PRIVATE_KEY }}
40+
owner: codat-internal
41+
repositories: sdk-codegen
42+
- name: Hand the release to the central publish pipeline
43+
run: |
44+
curl --fail-with-body --silent --show-error -X POST \
45+
-H "Accept: application/vnd.github+json" \
46+
-H "Authorization: Bearer ${{ steps.app_token.outputs.token }}" \
47+
https://api.github.com/repos/codat-internal/sdk-codegen/dispatches \
48+
-d '{"event_type": "publish-python", "client_payload": {"product": "lending", "sha": "${{ github.sha }}", "sdk_repo": "${{ github.repository }}", "prerelease": "${{ vars.PUBLISH_PRERELEASE }}"}}'
49+
echo "publish-python dispatch sent to codat-internal/sdk-codegen for lending @ ${{ github.sha }}${{ vars.PUBLISH_PRERELEASE && format(' as a {0} pre-release', vars.PUBLISH_PRERELEASE) || '' }}"
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Generation no longer runs in this repo: generate-and-pr.yml in Codat SDK
3+
# Codegen generates this SDK and opens a versioned PR here, dispatched by the
4+
# oas pipeline. This stub only says so.
15
name: Generate Platform library
26
'on':
37
workflow_dispatch:
@@ -11,15 +15,12 @@ name: Generate Platform library
1115
type: string
1216
jobs:
1317
generate:
14-
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
15-
with:
16-
mode: pr
17-
speakeasy_version: latest
18-
force: ${{ github.event.inputs.force }}
19-
set_version: ${{ github.event.inputs.set_version }}
20-
target: platform-library
21-
secrets:
22-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
23-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
24-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
25-
pypi_token: ${{ secrets.PYPI_TOKEN }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Generation moved to Codat SDK Codegen
21+
run: |
22+
echo "::warning::This workflow no longer generates anything. platform is generated by generate-and-pr.yml in Codat SDK Codegen, dispatched by the oas pipeline, which opens a versioned PR on this repo."
23+
# Exits 0 because the oas pipeline still runs this workflow on every OAS
24+
# merge; flip to exit 1 in the same change that switches the oas trigger
25+
# to the repository dispatch, so stray runs become loud.
26+
exit 0
Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,49 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Publishing no longer runs in this repo. The packaging checks, the PyPI upload,
3+
# the tag and the GitHub release all run centrally in publish-python.yml in
4+
# Codat SDK Codegen - no check has been dropped, they just moved. This stub
5+
# only forwards the release trigger there, authenticated with a short-lived
6+
# token minted from the GitHub App in the PUBLISH_TRIGGER_APP_* secrets.
7+
#
8+
# Set the PUBLISH_PRERELEASE Actions variable on this repo to rc1 to make the
9+
# next merge publish <version>rc1 rather than <version>. A plain
10+
# `pip install` skips pre-releases, so only people who ask for the rc by name
11+
# get it. Clear the variable once the real version has been promoted.
112
name: Release Platform library
213
'on':
314
push:
415
paths:
516
- platform/RELEASES.md
617
branches:
718
- main
19+
workflow_dispatch: {}
20+
concurrency: publish-platform-python
821
jobs:
922
publish:
10-
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
11-
secrets:
12-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
13-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
14-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
15-
pypi_token: ${{ secrets.PYPI_TOKEN }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check the App secrets are set
26+
env:
27+
APP_ID_SET: ${{ secrets.PUBLISH_TRIGGER_APP_ID != '' }}
28+
APP_KEY_SET: ${{ secrets.PUBLISH_TRIGGER_APP_PRIVATE_KEY != '' }}
29+
run: |
30+
if [ "$APP_ID_SET" != "true" ] || [ "$APP_KEY_SET" != "true" ]; then
31+
echo "::error::PUBLISH_TRIGGER_APP_ID / PUBLISH_TRIGGER_APP_PRIVATE_KEY secrets are not set - needed to mint the token that sends the publish-python repository dispatch to codat-internal/sdk-codegen"
32+
exit 1
33+
fi
34+
- name: Mint a token from the GitHub App
35+
id: app_token
36+
uses: actions/create-github-app-token@v2
37+
with:
38+
app-id: ${{ secrets.PUBLISH_TRIGGER_APP_ID }}
39+
private-key: ${{ secrets.PUBLISH_TRIGGER_APP_PRIVATE_KEY }}
40+
owner: codat-internal
41+
repositories: sdk-codegen
42+
- name: Hand the release to the central publish pipeline
43+
run: |
44+
curl --fail-with-body --silent --show-error -X POST \
45+
-H "Accept: application/vnd.github+json" \
46+
-H "Authorization: Bearer ${{ steps.app_token.outputs.token }}" \
47+
https://api.github.com/repos/codat-internal/sdk-codegen/dispatches \
48+
-d '{"event_type": "publish-python", "client_payload": {"product": "platform", "sha": "${{ github.sha }}", "sdk_repo": "${{ github.repository }}", "prerelease": "${{ vars.PUBLISH_PRERELEASE }}"}}'
49+
echo "publish-python dispatch sent to codat-internal/sdk-codegen for platform @ ${{ github.sha }}${{ vars.PUBLISH_PRERELEASE && format(' as a {0} pre-release', vars.PUBLISH_PRERELEASE) || '' }}"
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Generation no longer runs in this repo: generate-and-pr.yml in Codat SDK
3+
# Codegen generates this SDK and opens a versioned PR here, dispatched by the
4+
# oas pipeline. This stub only says so.
15
name: Generate Sync for Expenses library
26
'on':
37
workflow_dispatch:
@@ -11,15 +15,12 @@ name: Generate Sync for Expenses library
1115
type: string
1216
jobs:
1317
generate:
14-
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
15-
with:
16-
mode: pr
17-
speakeasy_version: latest
18-
force: ${{ github.event.inputs.force }}
19-
set_version: ${{ github.event.inputs.set_version }}
20-
target: sync-for-expenses-library
21-
secrets:
22-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
23-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
24-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
25-
pypi_token: ${{ secrets.PYPI_TOKEN }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Generation moved to Codat SDK Codegen
21+
run: |
22+
echo "::warning::This workflow no longer generates anything. sync-for-expenses is generated by generate-and-pr.yml in Codat SDK Codegen, dispatched by the oas pipeline, which opens a versioned PR on this repo."
23+
# Exits 0 because the oas pipeline still runs this workflow on every OAS
24+
# merge; flip to exit 1 in the same change that switches the oas trigger
25+
# to the repository dispatch, so stray runs become loud.
26+
exit 0
Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,49 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Publishing no longer runs in this repo. The packaging checks, the PyPI upload,
3+
# the tag and the GitHub release all run centrally in publish-python.yml in
4+
# Codat SDK Codegen - no check has been dropped, they just moved. This stub
5+
# only forwards the release trigger there, authenticated with a short-lived
6+
# token minted from the GitHub App in the PUBLISH_TRIGGER_APP_* secrets.
7+
#
8+
# Set the PUBLISH_PRERELEASE Actions variable on this repo to rc1 to make the
9+
# next merge publish <version>rc1 rather than <version>. A plain
10+
# `pip install` skips pre-releases, so only people who ask for the rc by name
11+
# get it. Clear the variable once the real version has been promoted.
112
name: Release Sync for Expenses library
213
'on':
314
push:
415
paths:
516
- sync-for-expenses/RELEASES.md
617
branches:
718
- main
19+
workflow_dispatch: {}
20+
concurrency: publish-sync-for-expenses-python
821
jobs:
922
publish:
10-
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
11-
secrets:
12-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
13-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
14-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
15-
pypi_token: ${{ secrets.PYPI_TOKEN }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check the App secrets are set
26+
env:
27+
APP_ID_SET: ${{ secrets.PUBLISH_TRIGGER_APP_ID != '' }}
28+
APP_KEY_SET: ${{ secrets.PUBLISH_TRIGGER_APP_PRIVATE_KEY != '' }}
29+
run: |
30+
if [ "$APP_ID_SET" != "true" ] || [ "$APP_KEY_SET" != "true" ]; then
31+
echo "::error::PUBLISH_TRIGGER_APP_ID / PUBLISH_TRIGGER_APP_PRIVATE_KEY secrets are not set - needed to mint the token that sends the publish-python repository dispatch to codat-internal/sdk-codegen"
32+
exit 1
33+
fi
34+
- name: Mint a token from the GitHub App
35+
id: app_token
36+
uses: actions/create-github-app-token@v2
37+
with:
38+
app-id: ${{ secrets.PUBLISH_TRIGGER_APP_ID }}
39+
private-key: ${{ secrets.PUBLISH_TRIGGER_APP_PRIVATE_KEY }}
40+
owner: codat-internal
41+
repositories: sdk-codegen
42+
- name: Hand the release to the central publish pipeline
43+
run: |
44+
curl --fail-with-body --silent --show-error -X POST \
45+
-H "Accept: application/vnd.github+json" \
46+
-H "Authorization: Bearer ${{ steps.app_token.outputs.token }}" \
47+
https://api.github.com/repos/codat-internal/sdk-codegen/dispatches \
48+
-d '{"event_type": "publish-python", "client_payload": {"product": "sync-for-expenses", "sha": "${{ github.sha }}", "sdk_repo": "${{ github.repository }}", "prerelease": "${{ vars.PUBLISH_PRERELEASE }}"}}'
49+
echo "publish-python dispatch sent to codat-internal/sdk-codegen for sync-for-expenses @ ${{ github.sha }}${{ vars.PUBLISH_PRERELEASE && format(' as a {0} pre-release', vars.PUBLISH_PRERELEASE) || '' }}"
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Written by sdk-codegen (emit_workflow_stubs.py); do not edit by hand.
2+
# Generation no longer runs in this repo: generate-and-pr.yml in Codat SDK
3+
# Codegen generates this SDK and opens a versioned PR here, dispatched by the
4+
# oas pipeline. This stub only says so.
15
name: Generate Sync for Payables library
26
'on':
37
workflow_dispatch:
@@ -11,15 +15,12 @@ name: Generate Sync for Payables library
1115
type: string
1216
jobs:
1317
generate:
14-
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
15-
with:
16-
mode: pr
17-
speakeasy_version: latest
18-
force: ${{ github.event.inputs.force }}
19-
set_version: ${{ github.event.inputs.set_version }}
20-
target: sync-for-payables-library
21-
secrets:
22-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
23-
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
24-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
25-
pypi_token: ${{ secrets.PYPI_TOKEN }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Generation moved to Codat SDK Codegen
21+
run: |
22+
echo "::warning::This workflow no longer generates anything. sync-for-payables is generated by generate-and-pr.yml in Codat SDK Codegen, dispatched by the oas pipeline, which opens a versioned PR on this repo."
23+
# Exits 0 because the oas pipeline still runs this workflow on every OAS
24+
# merge; flip to exit 1 in the same change that switches the oas trigger
25+
# to the repository dispatch, so stray runs become loud.
26+
exit 0

0 commit comments

Comments
 (0)