File tree Expand file tree Collapse file tree 2 files changed +15
-23
lines changed
Expand file tree Collapse file tree 2 files changed +15
-23
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,24 @@ name: Publish
44
55on :
66 workflow_dispatch :
7+ workflow_call :
8+ inputs :
9+ branch :
10+ description : The branch containing the release code snapshot
11+ required : true
12+ type : string
13+ default : " "
714 push :
815 branches :
916 - main
10- tags :
11- - ' v*.*.*'
12- release :
13- types :
14- - published
1517
1618permissions :
1719 contents : write
1820 id-token : write
1921
2022jobs :
2123 publish-ea :
22- if : startsWith( github.ref, 'refs/tags/') == false
24+ if : github.event_name == 'push'
2325 runs-on : ubuntu-latest
2426 name : Publish EA release to NPM
2527 steps :
@@ -70,14 +72,14 @@ jobs:
7072 npm publish --verbose --tag ea --access public --provenance
7173
7274 publish-release :
73- if : startsWith( github.ref, 'refs/tags/')
75+ if : github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch'
7476 runs-on : ubuntu-latest
7577 name : Publish release to NPM
7678 steps :
7779 - name : Checkout sources
7880 uses : actions/checkout@v4
7981 with :
80- ref : ${{ github.ref }}
82+ ref : ${{ inputs.branch || github.ref }}
8183 fetch-depth : 0
8284
8385 - name : Install node 24
9092 - name : Update npm
9193 run : npm install -g npm@latest
9294
93- - name : Get tag name
94- id : tag
95- run : |
96- TAG_NAME=${GITHUB_REF#refs/tags/}
97- echo "name=$TAG_NAME" >> "$GITHUB_OUTPUT"
98-
99- - name : Update package.json with tag version
100- id : update-version
101- run : |
102- TAG_NAME="${{ steps.tag.outputs.name }}"
103- # Remove 'v' prefix if present
104- VERSION=${TAG_NAME#v}
105- npm version "$VERSION" --no-git-tag-version
106- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
107-
10895 - name : Install project modules
10996 run : npm ci
11097
Original file line number Diff line number Diff line change @@ -111,3 +111,8 @@ jobs:
111111 env :
112112 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
113113
114+ - name : Run Publish pipeline
115+ uses : ./.github/workflows/publish.yml
116+ with :
117+ branch : " release/v${{ steps.bump.outputs.version }}"
118+
You can’t perform that action at this time.
0 commit comments