Skip to content

Commit b21005b

Browse files
ci: use PYPI_TOKEN for publishing and fix infinite generate loop (#160)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 1784582 commit b21005b

3 files changed

Lines changed: 16 additions & 20 deletions

File tree

.github/workflows/generate-command.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Triggers:
77
# - On push to main: Auto-generates after every merge to ensure SDK stays up-to-date (auto-merge enabled)
8-
# - Daily schedule (6 AM UTC): Catches upstream API spec changes (auto-merge enabled)
8+
# - Daily schedule (5 AM & 5 PM America/Los_Angeles): Catches upstream API spec changes (auto-merge enabled)
99
# - Manual workflow_dispatch: For on-demand generation
1010
# - Slash command (/generate): Regenerates and pushes results back to the PR branch
1111
# - workflow_call: For validation from other workflows (e.g., PR checks)
@@ -30,7 +30,10 @@ name: Generate SDK
3030
branches:
3131
- main
3232
schedule:
33-
- cron: '0 6 * * *'
33+
- cron: '0 5 * * *'
34+
timezone: America/Los_Angeles
35+
- cron: '0 17 * * *'
36+
timezone: America/Los_Angeles
3437
workflow_dispatch:
3538
inputs:
3639
dry_run:
@@ -203,6 +206,9 @@ jobs:
203206
if: ${{ !inputs.dry_run }}
204207
id: changes
205208
run: |
209+
# Restore workflow.lock to HEAD to ignore non-deterministic
210+
# digest changes that cause infinite generate→merge loops.
211+
git checkout HEAD -- .speakeasy/workflow.lock 2>/dev/null || true
206212
if [ -n "$(git status --porcelain)" ]; then
207213
echo "has_changes=true" >> $GITHUB_OUTPUT
208214
else

.github/workflows/pre-release-command.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ jobs:
5353
pre_release:
5454
name: Build & Publish Pre-Release
5555
runs-on: ubuntu-latest
56-
environment:
57-
name: pypi
58-
url: https://pypi.org/project/airbyte-api/
5956
permissions:
6057
contents: write
6158
pull-requests: write
62-
id-token: write
6359
steps:
6460
# ── Slash command: post starting comment ────────────────────────
6561
- name: Authenticate as GitHub App
@@ -129,7 +125,9 @@ jobs:
129125
run: uv build
130126

131127
- name: Publish to PyPI
132-
uses: pypa/gh-action-pypi-publish@release/v1
128+
run: uv publish
129+
env:
130+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
133131

134132
# ── Tag the commit ──────────────────────────────────────────────
135133
- name: Create and push tag

.github/workflows/publish.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
# PyPI Publish Workflow
22
#
33
# Triggered when a GitHub Release is published (draft → published).
4-
# Builds the Python package and uploads it to PyPI using OIDC trusted publishing.
4+
# Builds the Python package and uploads it to PyPI using PYPI_TOKEN.
55
#
66
# Prerequisites:
7-
# - PyPI trusted publisher configured for this repository:
8-
# https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
9-
# Owner: airbytehq
10-
# Repository: airbyte-api-python-sdk
11-
# Workflow: publish.yml
12-
# Environment: pypi
7+
# - PYPI_TOKEN secret configured in the repository
138

149
name: Publish to PyPI
1510

@@ -24,11 +19,6 @@ jobs:
2419
publish:
2520
name: Build & Publish to PyPI
2621
runs-on: ubuntu-latest
27-
environment:
28-
name: pypi
29-
url: https://pypi.org/project/airbyte-api/
30-
permissions:
31-
id-token: write
3222
steps:
3323
- name: Checkout repository
3424
uses: actions/checkout@v4
@@ -42,4 +32,6 @@ jobs:
4232
run: uv build
4333

4434
- name: Publish to PyPI
45-
uses: pypa/gh-action-pypi-publish@release/v1
35+
run: uv publish
36+
env:
37+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)