|
1 | 1 | name: Claude Tag Release |
2 | 2 |
|
3 | 3 | 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 |
7 | 25 |
|
8 | 26 | jobs: |
9 | 27 | action: |
10 | 28 | runs-on: ubuntu-latest # Use GitHub-hosted runners for memory-intensive git/Claude operations |
11 | | - timeout-minutes: 10 |
| 29 | + timeout-minutes: 15 |
12 | 30 | permissions: |
13 | 31 | 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 }} |
14 | 36 | steps: |
15 | 37 | - name: Checkout |
16 | 38 | uses: actions/checkout@v4 |
|
24 | 46 | run: | |
25 | 47 | VERSION=$(grep "^version = " pyproject.toml | sed 's/version = "\(.*\)"/\1/') |
26 | 48 | echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 49 | + echo "tag_name=v$VERSION" >> $GITHUB_OUTPUT |
27 | 50 | echo "Found version: $VERSION" |
28 | 51 |
|
29 | 52 | - name: Check If Tag Exists |
@@ -164,7 +187,7 @@ jobs: |
164 | 187 | ] |
165 | 188 | }') |
166 | 189 |
|
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" \ |
168 | 191 | -H "Content-Type: application/json" \ |
169 | 192 | -H "x-api-key: ${{ secrets.ANTHROPIC_API_KEY }}" \ |
170 | 193 | -H "anthropic-version: 2023-06-01" \ |
@@ -205,6 +228,7 @@ jobs: |
205 | 228 |
|
206 | 229 | - name: Create GitHub Release |
207 | 230 | if: steps.check-tag.outputs.tag_exists == 'false' |
| 231 | + id: create-release |
208 | 232 | uses: softprops/action-gh-release@v1 |
209 | 233 | with: |
210 | 234 | tag_name: v${{ steps.get-version.outputs.version }} |
|
0 commit comments