@@ -18,43 +18,18 @@ jobs:
1818 runs-on : ubuntu-24.04
1919 timeout-minutes : 5
2020 steps :
21- - uses : actions/checkout@v4
21+ - uses : actions/checkout@v5
2222 with :
2323 token : ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
24- - run : |
25- git config --global user.name 'AboutBits Tech'
26- git config --global user.email 'tech@aboutbits.it'
27- - uses : aboutbits/github-actions-node/setup-and-install@v2
24+ - uses : aboutbits/github-actions-base/git-setup@v2
25+ - uses : aboutbits/github-actions-node/build-and-publish-package@v3
26+ id : package
2827 with :
2928 node-version : ${{ env.NODE_VERSION }}
3029 registry-url : ' https://registry.npmjs.org'
31- - name : Get current package version
32- id : currentVersion
33- run : echo "currentVersion=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
34- - name : Validate prerelease increment
35- if : github.event.inputs.increment == 'prerelease' && !contains(steps.currentVersion.outputs.currentVersion, '-')
36- run : exit 1
37- - name : npm version
38- run : |
39- if [ -n "${{ github.event.inputs.preid }}" ]; then
40- npm version ${{ github.event.inputs.increment }} --preid ${{ github.event.inputs.preid }}
41- else
42- npm version ${{ github.event.inputs.increment }}
43- fi
44- - name : Get next package version
45- id : nextVersion
46- run : echo "nextVersion=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
47- - run : npm publish
48- env :
49- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
50- - name : Create GitHub release
51- uses : actions/github-script@v7
30+ registry-token : ${{ secrets.NPM_TOKEN }}
31+ increment : ${{ github.event.inputs.increment }}
32+ preid : ${{ github.event.inputs.preid }}
33+ - uses : aboutbits/github-actions-base/github-create-release@v2
5234 with :
53- script : |
54- github.rest.repos.createRelease({
55- owner: context.repo.owner,
56- repo: context.repo.repo,
57- tag_name: 'v${{ steps.nextVersion.outputs.nextVersion }}',
58- name: 'v${{ steps.nextVersion.outputs.nextVersion }}',
59- prerelease: '${{ steps.nextVersion.outputs.nextVersion }}'.includes('-')
60- })
35+ tag-name : ' ${{ steps.package.outputs.version }}'
0 commit comments