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
48 changes: 48 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Create Release Tag

on:
push:
branches:
- main

env:
CI: true

jobs:
create-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine if latest commit is a version bump
id: check
run: |
commit_message=$(git log -1 --pretty=%B)
echo "Latest commit message: $commit_message"
if [[ "$commit_message" == "chore: update versions"* ]]; then
echo "is_version_bump=true" >> "$GITHUB_OUTPUT"
else
echo "is_version_bump=false" >> "$GITHUB_OUTPUT"
fi

- name: Create and push git tag
if: steps.check.outputs.is_version_bump == 'true'
run: |
version=$(jq -r '.version' packages/agents/package.json)
tag="v${version}"
echo "Tag derived from package version: $tag"

if git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then
echo "Tag $tag already exists. Skipping."
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$tag" -m "Release $tag"
git push origin "$tag"
28 changes: 2 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Changesets
name: Changesets Release

on:
workflow_run:
Expand Down Expand Up @@ -45,34 +45,10 @@ jobs:
with:
commit: 'chore: update versions'
title: 'chore: update versions'
version: pnpm bump-version
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
NPM_CONFIG_ACCESS: public

- name: Push metadata changes
run: |
files="packages/agents-core/src/metadata.ts packages/agents-extensions/src/metadata.ts packages/agents-openai/src/metadata.ts packages/agents-realtime/src/metadata.ts packages/agents/src/metadata.ts"
if git diff --quiet -- $files; then
echo "No metadata changes to push"
else
# -- Commit all the metadata.ts files --
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add $files
git commit -m "chore: sync metadata files"
git push origin HEAD:main
# -- Push a new release tag as well --
# We don't use changeset release command because we always do release for all the packages
# Thus, creating git tags manually here
version=$(jq -r '.version' packages/agents/package.json)
tag="v${version}"
if git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then
echo "Tag $tag already exists"
else
git tag -a "$tag" -m "Release $tag"
git push origin "$tag"
fi
fi
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"examples:tools-file-search": "pnpm -F tools start:file-search",
"examples:tools-web-search": "pnpm -F tools start:web-search",
"ci:publish": "pnpm publish -r --no-git-checks",
"bump-version": "changeset version && pnpm -F @openai/* prebuild",
"prepare": "husky",
"clear:deps": "rm -rf node_modules && pnpm -r exec rm -rf node_modules",
"local-npm:reset": "rm -rf .cache/verdaccio/storage",
Expand Down