Skip to content

Commit 03d9032

Browse files
committed
Enhance GitHub workflows for release process
- Added outputs for new version and branch name in create-release workflow. - Introduced create-tag job to handle tagging after release creation. - Updated create-summary step to reflect new tag and release URL instead of version and branch. - Modified tag-release workflow to accept branch reference as input and provide outputs for tag name, version, and release URL. These changes streamline the release process and improve the clarity of the summary generated after a release.
1 parent ca80a15 commit 03d9032

2 files changed

Lines changed: 52 additions & 8 deletions

File tree

.github/workflows/create-release.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on:
1616
jobs:
1717
create-release:
1818
runs-on: ubuntu-latest
19+
outputs:
20+
new_version: ${{ steps.new-version.outputs.new_version }}
21+
branch_name: ${{ steps.new-version.outputs.branch_name }}
1922

2023
steps:
2124
- name: Checkout code
@@ -105,15 +108,32 @@ jobs:
105108
106109
echo "✅ Release branch created: $BRANCH_NAME"
107110
111+
create-tag:
112+
needs: create-release
113+
permissions:
114+
contents: write
115+
uses: ./.github/workflows/tag-release.yml
116+
with:
117+
branch_ref: ${{ needs.create-release.outputs.branch_name }}
118+
secrets: inherit
119+
120+
create-summary:
121+
needs: [create-release, create-tag]
122+
if: always()
123+
runs-on: ubuntu-latest
124+
steps:
108125
- name: Create summary
109126
run: |
110127
echo "## 🚀 Python SDK Release Created" >> $GITHUB_STEP_SUMMARY
111128
echo "" >> $GITHUB_STEP_SUMMARY
112-
echo "**Version:** ${{ steps.current-version.outputs.current_version }} → ${{ steps.new-version.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
113-
echo "**Branch:** \`${{ steps.new-version.outputs.branch_name }}\`" >> $GITHUB_STEP_SUMMARY
129+
echo "**Version:** ${{ needs.create-tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY
130+
echo "**Tag:** \`${{ needs.create-tag.outputs.tag_name }}\`" >> $GITHUB_STEP_SUMMARY
131+
echo "**Branch:** \`${{ needs.create-release.outputs.branch_name }}\`" >> $GITHUB_STEP_SUMMARY
114132
echo "**Type:** ${{ inputs.version_type }}" >> $GITHUB_STEP_SUMMARY
115133
echo "" >> $GITHUB_STEP_SUMMARY
134+
echo "**Release URL:** ${{ needs.create-tag.outputs.release_url }}" >> $GITHUB_STEP_SUMMARY
135+
echo "" >> $GITHUB_STEP_SUMMARY
116136
echo "### Next Steps" >> $GITHUB_STEP_SUMMARY
117-
echo "The PyPI package will be automatically published when the release branch is pushed." >> $GITHUB_STEP_SUMMARY
137+
echo "The PyPI package will be automatically published when the release tag is created." >> $GITHUB_STEP_SUMMARY
118138
echo "" >> $GITHUB_STEP_SUMMARY
119139
echo "Monitor the publish workflow: [View Workflows](https://github.com/RoboFinSystems/robosystems-python-client/actions/workflows/publish.yml)" >> $GITHUB_STEP_SUMMARY

.github/workflows/tag-release.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
11
name: Claude Tag Release
22

33
on:
4-
push:
5-
branches:
6-
- "release/**"
4+
workflow_call:
5+
inputs:
6+
branch_ref:
7+
description: 'The branch ref to tag'
8+
required: true
9+
type: string
10+
outputs:
11+
tag_name:
12+
description: 'The created tag name'
13+
value: ${{ jobs.action.outputs.tag_name }}
14+
version:
15+
description: 'The version number'
16+
value: ${{ jobs.action.outputs.version }}
17+
release_url:
18+
description: 'The GitHub release URL'
19+
value: ${{ jobs.action.outputs.release_url }}
20+
secrets:
21+
ACTIONS_TOKEN:
22+
required: true
23+
ANTHROPIC_API_KEY:
24+
required: true
725

826
jobs:
927
action:
1028
runs-on: ubuntu-latest # Use GitHub-hosted runners for memory-intensive git/Claude operations
11-
timeout-minutes: 10
29+
timeout-minutes: 15
1230
permissions:
1331
contents: write
32+
outputs:
33+
tag_name: ${{ steps.get-version.outputs.tag_name }}
34+
version: ${{ steps.get-version.outputs.version }}
35+
release_url: ${{ steps.create-release.outputs.upload_url }}
1436
steps:
1537
- name: Checkout
1638
uses: actions/checkout@v4
@@ -24,6 +46,7 @@ jobs:
2446
run: |
2547
VERSION=$(grep "^version = " pyproject.toml | sed 's/version = "\(.*\)"/\1/')
2648
echo "version=$VERSION" >> $GITHUB_OUTPUT
49+
echo "tag_name=v$VERSION" >> $GITHUB_OUTPUT
2750
echo "Found version: $VERSION"
2851
2952
- name: Check If Tag Exists
@@ -164,7 +187,7 @@ jobs:
164187
]
165188
}')
166189
167-
RESPONSE=$(curl -s -X POST "https://api.anthropic.com/v1/messages" \
190+
RESPONSE=$(curl -s --max-time 60 --retry 3 --retry-delay 10 -X POST "https://api.anthropic.com/v1/messages" \
168191
-H "Content-Type: application/json" \
169192
-H "x-api-key: ${{ secrets.ANTHROPIC_API_KEY }}" \
170193
-H "anthropic-version: 2023-06-01" \
@@ -205,6 +228,7 @@ jobs:
205228
206229
- name: Create GitHub Release
207230
if: steps.check-tag.outputs.tag_exists == 'false'
231+
id: create-release
208232
uses: softprops/action-gh-release@v1
209233
with:
210234
tag_name: v${{ steps.get-version.outputs.version }}

0 commit comments

Comments
 (0)