Skip to content

Commit 9b85d72

Browse files
committed
refactor: bump-version triggers release via workflow_dispatch
Avoids workflow_call permission issues. bump-version creates tag then triggers release.yml with version input via gh CLI.
1 parent d5f89a9 commit 9b85d72

2 files changed

Lines changed: 10 additions & 21 deletions

File tree

.github/workflows/bump-version.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
permissions:
2020
contents: write
21-
outputs:
22-
version: ${{ steps.next.outputs.version }}
23-
version_number: ${{ steps.next.outputs.version_number }}
21+
actions: write
2422

2523
steps:
2624
- uses: actions/checkout@v4
@@ -49,7 +47,6 @@ jobs:
4947
5048
NEXT="v${MAJOR}.${MINOR}.${PATCH}"
5149
echo "version=$NEXT" >> $GITHUB_OUTPUT
52-
echo "version_number=${MAJOR}.${MINOR}.${PATCH}" >> $GITHUB_OUTPUT
5350
echo "Next version: $NEXT"
5451
5552
- name: Create and push tag
@@ -59,11 +56,7 @@ jobs:
5956
git tag -a "${{ steps.next.outputs.version }}" -m "Release ${{ steps.next.outputs.version }}"
6057
git push origin "${{ steps.next.outputs.version }}"
6158
62-
release:
63-
name: Release
64-
needs: bump
65-
uses: ./.github/workflows/release.yml
66-
with:
67-
version: ${{ needs.bump.outputs.version }}
68-
version_number: ${{ needs.bump.outputs.version_number }}
69-
secrets: inherit
59+
- name: Trigger release pipeline
60+
run: gh workflow run release.yml -f version=${{ steps.next.outputs.version }}
61+
env:
62+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ on:
44
push:
55
tags:
66
- 'v*'
7-
workflow_call:
7+
workflow_dispatch:
88
inputs:
99
version:
1010
description: 'Version tag (e.g. v0.1.3)'
1111
required: true
1212
type: string
13-
version_number:
14-
description: 'Version number without v prefix (e.g. 0.1.3)'
15-
required: true
16-
type: string
1713

1814
jobs:
1915
resolve:
@@ -27,13 +23,13 @@ jobs:
2723
id: resolve
2824
run: |
2925
if [ -n "${{ inputs.version }}" ]; then
30-
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
31-
echo "version_number=${{ inputs.version_number }}" >> $GITHUB_OUTPUT
26+
TAG="${{ inputs.version }}"
3227
else
3328
TAG="${GITHUB_REF#refs/tags/}"
34-
echo "version=$TAG" >> $GITHUB_OUTPUT
35-
echo "version_number=${TAG#v}" >> $GITHUB_OUTPUT
3629
fi
30+
echo "version=$TAG" >> $GITHUB_OUTPUT
31+
echo "version_number=${TAG#v}" >> $GITHUB_OUTPUT
32+
echo "Releasing: $TAG"
3733
3834
pypi:
3935
name: Deploy to PyPI

0 commit comments

Comments
 (0)