use release-plz to prepare GDK releases (#11820)
This commit is contained in:
@@ -330,6 +330,16 @@ jobs:
|
||||
cd ui/goose-acp-client
|
||||
pnpm run lint
|
||||
|
||||
gdk-release-config-check:
|
||||
name: Check GDK Release Configuration
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Check GDK crate membership and publication order
|
||||
run: python3 crates/goose-sdk/scripts/gdk-release.py check-config
|
||||
|
||||
gdk-api-docs-check:
|
||||
name: Check GDK API Reference is Up-to-Date
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
name: Prepare GDK release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- gdk-release-plz # Temporary: remove after validating this workflow
|
||||
paths:
|
||||
# BEGIN GDK CRATE PATHS
|
||||
- "crates/goose-provider-types/**"
|
||||
- "crates/goose-sdk-types/**"
|
||||
- "crates/goose-download-manager/**"
|
||||
- "crates/goose-local-inference/**"
|
||||
- "crates/goose-providers/**"
|
||||
- "crates/goose-agent/**"
|
||||
- "crates/goose-context-management/**"
|
||||
- "crates/goose-sdk/**"
|
||||
# END GDK CRATE PATHS
|
||||
- "release-plz.toml"
|
||||
- "Cargo.lock"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: gdk-release-pr
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
release-pr:
|
||||
name: Create or update GDK release PR
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Activate Hermit
|
||||
uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
|
||||
|
||||
- name: Create or update release PR
|
||||
id: release-plz
|
||||
uses: release-plz/action@b5543c19b03be9bd48852d20ca89f478b7723260 # v0.5.132
|
||||
with:
|
||||
command: release-pr
|
||||
config: release-plz.toml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Synchronize GDK release artifacts
|
||||
if: steps.release-plz.outputs.prs_created == 'true'
|
||||
env:
|
||||
RELEASE_PR: ${{ steps.release-plz.outputs.pr }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
branch=$(jq -r '.head_branch' <<< "$RELEASE_PR")
|
||||
git fetch origin "$branch"
|
||||
git switch "$branch"
|
||||
just --justfile crates/goose-sdk/justfile sync-release-artifacts
|
||||
if git diff --quiet; then
|
||||
exit 0
|
||||
fi
|
||||
git add \
|
||||
crates/goose-sdk/python/pyproject.toml \
|
||||
documentation/src/data/gdk-api.json
|
||||
git commit -m "chore: synchronize GDK release artifacts"
|
||||
git push origin HEAD:"$branch"
|
||||
|
||||
- name: Validate package versions
|
||||
if: steps.release-plz.outputs.prs_created == 'true'
|
||||
run: |
|
||||
version=$(cargo metadata --no-deps --format-version 1 | jq -r \
|
||||
'.packages[] | select(.name == "goose-sdk") | .version')
|
||||
just --justfile crates/goose-sdk/justfile check-version "$version"
|
||||
@@ -4,18 +4,11 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- "gdk-v*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: GDK version to publish (for example, 0.1.0-alpha.6)
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: gdk-release-${{ github.event_name == 'workflow_dispatch' && format('gdk-v{0}', inputs.version) || github.ref_name }}
|
||||
group: gdk-release-${{ github.ref_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
@@ -31,9 +24,7 @@ jobs:
|
||||
- name: Resolve release version
|
||||
id: version
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
run: echo "value=${INPUT_VERSION:-${GITHUB_REF_NAME#gdk-v}}" >> "$GITHUB_OUTPUT"
|
||||
run: echo "value=${GITHUB_REF_NAME#gdk-v}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Install just
|
||||
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
|
||||
|
||||
Reference in New Issue
Block a user