33name : Publish
44
55on :
6- workflow_run :
7- workflows : ["Integration Tests"]
8- types :
9- - completed
6+ workflow_dispatch :
107 push :
8+ branches :
9+ - main
1110 tags :
1211 - ' v*.*.*'
1312
@@ -17,17 +16,14 @@ permissions:
1716
1817jobs :
1918 publish-ea :
20- if : |
21- github.event_name == 'workflow_run' &&
22- github.event.workflow_run.event == 'push' &&
23- github.event.workflow_run.head_branch == 'main'
19+ if : startsWith(github.ref, 'refs/tags/') == false
2420 runs-on : ubuntu-latest
2521 name : Publish EA release to NPM
2622 steps :
2723 - name : Checkout sources
2824 uses : actions/checkout@v4
2925 with :
30- ref : ${{ github.event.workflow_run.head_branch }}
26+ ref : ${{ github.ref_name }}
3127 fetch-depth : 0
3228
3329 - name : Install node 24
4541 git config user.name "${{ github.actor }}"
4642 git config user.email "${{ github.actor }}@users.noreply.github.com"
4743
48- - name : Reset to workflow run commit
44+ - name : Reset to commit
4945 run : |
50- git reset --hard ${{ github.event.workflow_run.head_sha }}
46+ git reset --hard ${{ github.sha }}
5147
5248 - name : Get current version
5349 id : current-version
@@ -65,13 +61,13 @@ jobs:
6561
6662 - name : Publish package
6763 run : |
68- SHORT_SHA=$(git rev-parse --short "${{ github.event.workflow_run.head_sha }}")
64+ SHORT_SHA=$(git rev-parse --short "${{ github.sha }}")
6965 EA_VERSION="${{ steps.current-version.outputs.base-version }}-ea.${SHORT_SHA}"
7066 npm version "$EA_VERSION" --no-git-tag-version
7167 npm publish --verbose --tag ea --access public --provenance
7268
7369 publish-release :
74- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
70+ if : startsWith(github.ref, 'refs/tags/')
7571 runs-on : ubuntu-latest
7672 name : Publish release to NPM
7773 steps :
0 commit comments