Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/sdk_merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,26 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
environment: sdk-release
outputs:
notify: ${{ steps.bot.outputs.notify }}
pr: ${{ steps.bot.outputs.pr }}
steps:
- id: bot
uses: gr4vy/sdk-release/release-bot@f956131fcbeaa05d2afcd763f7f8e8122ed823e2
uses: gr4vy/sdk-release/release-bot@4d17bbfa966f12d70db408bb1d0acc30576e0647
with:
sdk: python
run-id: ${{ github.event.workflow_run.id }}
client-id: ${{ secrets.SDK_RELEASE_APP_CLIENT_ID }}
private-key: ${{ secrets.SDK_RELEASE_APP_PRIVATE_KEY }}

# Kept out of `decide`, which holds the release App key: the Slack action
# runs a container image.
notify:
needs: decide
if: needs.decide.outputs.notify == 'true'
runs-on: ubuntu-latest
steps:
- name: Slack Notification
if: steps.bot.outputs.notify == 'true'
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
env:
SLACK_USERNAME: Python SDK
Expand All @@ -37,5 +46,5 @@ jobs:
SLACK_MSG_AUTHOR: gr4vy
SLACK_ICON_EMOJI: ":gr4vy-sdk:"
SLACK_COLOR: "warning"
SLACK_MESSAGE: "Speakeasy PR needs a human: ${{ github.server_url }}/${{ github.repository }}/pull/${{ steps.bot.outputs.pr }}"
SLACK_MESSAGE: "Speakeasy PR needs a human: ${{ github.server_url }}/${{ github.repository }}/pull/${{ needs.decide.outputs.pr }}"
SLACK_FOOTER: ""
15 changes: 14 additions & 1 deletion .github/workflows/sdk_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,28 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
actions: read
contents: read
pull-requests: read
outputs:
publish: ${{ steps.gate.outputs.publish }}
mode: ${{ github.event_name == 'workflow_dispatch' && 'manual' || steps.gate.outputs.mode }}
version: ${{ steps.gate.outputs.version }}
steps:
- name: Require a green CI run on this commit
if: github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ github.token }}
SHA: ${{ github.sha }}
run: |
passed=$(gh api "repos/$GITHUB_REPOSITORY/actions/workflows/ci.yaml/runs?head_sha=$SHA&branch=main&event=push&status=success" --jq '.total_count')
Comment thread
cbetta marked this conversation as resolved.
Resolved
if [ "$passed" = "0" ]; then
echo "::error::CI hasn't passed on main for $SHA, so it can't be released"
exit 1
fi
Comment thread
cbetta marked this conversation as resolved.
Resolved

- id: gate
uses: gr4vy/sdk-release/publish-gate@f956131fcbeaa05d2afcd763f7f8e8122ed823e2
uses: gr4vy/sdk-release/publish-gate@4d17bbfa966f12d70db408bb1d0acc30576e0647
with:
head-sha: ${{ github.event.workflow_run.head_sha || github.sha }}
bot-login: gr4vy-sdk-release[bot]
Expand Down
Loading