@@ -18,44 +18,17 @@ jobs:
1818 runs-on : ubuntu-latest
1919 steps :
2020 - uses : actions/checkout@v4
21- # use python 2.7 to build node-gyp
22- - uses : actions/setup-python@v5
23- with :
24- python-version : ' 2.7'
25- # use node 6 to build, as v3 is an old version
26- - uses : actions/setup-node@v4
27- with :
28- node-version : ' 6'
29- registry-url : ' https://registry.npmjs.org'
30- - uses : actions/cache@v4
31- with :
32- path : ~/.npm
33- key : ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
34- restore-keys : ${{ runner.OS }}-node-
35- - run : npm install
36-
21+ # use node:6 docker image to build, as v3 is an old version requiring node-gyp with python 2.7
22+ - name : Build with Node 6 (via Docker)
23+ run : docker run --rm -v $(pwd):/app -w /app node:6 sh -c "npm install && npm run build"
24+
3725 # use node 20 to publish
3826 - uses : actions/setup-node@v4
3927 with :
4028 node-version : ' 20'
4129 registry-url : ' https://registry.npmjs.org'
42- - uses : actions/cache@v4
43- with :
44- path : ~/.npm
45- key : ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
46- restore-keys : ${{ runner.OS }}-node-
47- - run : npm run build
4830
4931 # Ensure npm 11.5.1 or later is installed
5032 - name : Update npm
5133 run : npm install -g npm@latest
52- - name : ' Determine NPM tag: latest or next depending if we are on a prerelease or not (version with hyphen should be a prerelease)'
53- id : npm_tag
54- run : |
55- VERSION=$(node -p "require('./package.json').version")
56- if [[ $VERSION == *-* ]]; then
57- echo "TAG=next" >> "$GITHUB_OUTPUT"
58- else
59- echo "TAG=latest" >> "$GITHUB_OUTPUT"
60- fi
61- - run : cd npm && npm publish --tag ${{ steps.npm_tag.outputs.TAG }}
34+ - run : npm publish --tag version-4
0 commit comments