File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 **/*test-results*
5959 **/*coverage*
6060 retention-days : 7
61+
62+ publish-pr :
63+ if : >-
64+ github.event_name == 'pull_request' &&
65+ github.event.pull_request.head.repo.full_name == github.repository
66+ needs : build
67+ runs-on : ubuntu-latest
68+ permissions :
69+ contents : read
70+ packages : write
71+ steps :
72+ - name : Download build artifact
73+ uses : actions/download-artifact@v5
74+ with :
75+ name : build-dist
76+ path : ./package
77+
78+ - name : Setup Node.js for GitHub Packages
79+ uses : actions/setup-node@v4
80+ with :
81+ node-version : " 22"
82+ registry-url : " https://npm.pkg.github.com"
83+ scope : " @crispthinking"
84+
85+ - name : Set pre-release version
86+ working-directory : ./package
87+ run : |
88+ PR_NUMBER=${{ github.event.pull_request.number }}
89+ SHORT_SHA=${GITHUB_SHA::7}
90+ VERSION="0.0.0-pr.${PR_NUMBER}.${SHORT_SHA}"
91+ npm --no-git-tag-version version "$VERSION"
92+
93+ - name : Publish pre-release package
94+ working-directory : ./package
95+ env :
96+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
97+ run : |
98+ PR_TAG="pr-${{ github.event.pull_request.number }}"
99+ npm publish --tag "$PR_TAG"
You can’t perform that action at this time.
0 commit comments