@@ -18,61 +18,11 @@ jobs:
1818 # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1919 node-version : [ 18.x, 20.x, 22.x ]
2020 steps :
21- - uses : actions/checkout@v4
21+ - uses : actions/checkout@v6
2222 - name : Use Node.js ${{ matrix.node-version }}
23- uses : actions/setup-node@v4
23+ uses : actions/setup-node@v6
2424 with :
2525 node-version : ${{ matrix.node-version }}
2626 cache : ' npm'
2727 - run : npm ci
2828 - run : npm run build
29- - name : Store artifacts
30- if : matrix.node-version == '20.x'
31- uses : actions/upload-artifact@v4
32- with :
33- name : build-assets
34- path : assets/
35- release :
36- runs-on : ubuntu-latest
37- # Wait for build because we need the build artifacts here
38- needs : [ build ]
39- # Only run when pushing to main branch
40- if : github.event_name != 'pull_request'
41- steps :
42- - uses : actions/checkout@v4
43- # Download artifact instead of rebuilding
44- - uses : actions/download-artifact@v4
45- with :
46- name : build-assets
47- path : assets/
48- - run : echo "HSLUV_VERSION=$(cat assets/VERSION)" >> ${{ github.env }}
49- - uses : rickstaa/action-create-tag@v1
50- id : create-tag
51- # When tag already exists, do not fail the job
52- continue-on-error : true
53- with :
54- tag : " v${{ env.HSLUV_VERSION }}"
55- - uses : ncipollo/release-action@v1
56- if : ${{ steps.create-tag.outcome == 'success' }}
57- with :
58- artifacts : assets/hsluv-${{ env.HSLUV_VERSION }}.min.js
59- tag : v${{ env.HSLUV_VERSION }}
60- draft : true
61- omitBody : true
62- prerelease : ${{ contains(env.HSLUV_VERSION, 'rc') }}
63- bodyFile : " body.md"
64- token : ${{ secrets.GITHUB_TOKEN }}
65- # https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
66- - uses : actions/setup-node@v4
67- if : ${{ steps.create-tag.outcome == 'success' }}
68- with :
69- node-version : ' 22.x'
70- registry-url : ' https://registry.npmjs.org'
71- - run : npm publish ./assets/hsluv-${{ env.HSLUV_VERSION }}.tgz --tag rc
72- if : ${{ steps.create-tag.outcome == 'success' && contains(env.HSLUV_VERSION, 'rc') }}
73- env :
74- NODE_AUTH_TOKEN : ${{ secrets.HSLUV_NPM_AUTOMATION_TOKEN }}
75- - run : npm publish ./assets/hsluv-${{ env.HSLUV_VERSION }}.tgz
76- if : ${{ steps.create-tag.outcome == 'success' && !contains(env.HSLUV_VERSION, 'rc') }}
77- env :
78- NODE_AUTH_TOKEN : ${{ secrets.HSLUV_NPM_AUTOMATION_TOKEN }}
0 commit comments