2525run :|
2626 export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)"
2727 echo "Next version is ${NEXT_VERSION}"
28- echo "${NEXT_VERSION}" >. version
28+ echo "${NEXT_VERSION}" >next- version.txt
2929 echo "version=${NEXT_VERSION}" >> $GITHUB_ENV
3030 -name :Get next npm tag name
3131run :|
@@ -37,22 +37,22 @@ jobs:
3737 export PUBLISH_TAG="pr"
3838 fi
3939 echo "Next tag is ${PUBLISH_TAG}"
40- echo "${PUBLISH_TAG}" >. tag
40+ echo "${PUBLISH_TAG}" >publish- tag.txt
4141 -name :Upload versions
4242uses :actions/upload-artifact@v3
4343with :
4444name :versions
4545if-no-files-found :error
4646path :|
47- . version
48- . tag
47+ next- version.txt
48+ publish- tag.txt
4949
5050build :
5151runs-on :ubuntu-latest
5252needs :[version]
5353strategy :
5454matrix :
55- node-version :[16.x, 18.x, 20.x]
55+ node-version :[16.x, 18.x, 20.x, 22.x ]
5656steps :
5757 -uses :actions/checkout@v3
5858with :
6464cache :' npm'
6565 -name :Log environment setup
6666run :|
67- node -v
68- npm -v
67+ node -v
68+ npm -v
6969 -name :Install dependencies
7070run :npm install
7171 -name :Build templates
@@ -86,60 +86,60 @@ jobs:
8686with :
8787name :versions
8888 -name :Store version
89- run :echo "version=$(cat. version)" >> $GITHUB_ENV
89+ run :echo "version=$(catnext- version.txt )" >> $GITHUB_ENV
9090 -name :Configure Git
9191run :|
92- git config user.email "gh-actions@users.noreply.github.com"
93- git config user.name "GitHub Actions"
92+ git config user.email "gh-actions@users.noreply.github.com"
93+ git config user.name "GitHub Actions"
9494 -name :Tag commit
9595uses :tvdias/github-tagger@v0.0.1
9696with :
97- repo-token :" ${{ secrets.GITHUB_TOKEN }}"
98- tag :" ${{ env.version }}"
97+ repo-token :' ${{ secrets.GITHUB_TOKEN }}'
98+ tag :' ${{ env.version }}'
9999 -name :Install dependencies
100100run :npm install
101101 -uses :actions/setup-node@v3
102102with :
103103registry-url :' https://registry.npmjs.org'
104- node-version :' 18 .x'
104+ node-version :' 22 .x'
105105 -name :Configure NPM version
106106env :
107107NODE_AUTH_TOKEN :${{ secrets.NPM_TOKEN }}
108108run :|
109- rm -f .npmrc
110- touch .npmrc
111- echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
112- echo "registry=https://registry.npmjs.org/" >> .npmrc
113- echo "access=public" >> .npmrc
114- echo "save-exact=true" >> .npmrc
109+ rm -f .npmrc
110+ touch .npmrc
111+ echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
112+ echo "registry=https://registry.npmjs.org/" >> .npmrc
113+ echo "access=public" >> .npmrc
114+ echo "save-exact=true" >> .npmrc
115115 -name :Version package
116116run :|
117- # Update version in packages to publish
118- npm version $(cat. version) -m "Release version %s"
117+ # Update version in packages to publish
118+ npm version $(catnext- version.txt ) -m "Release version %s"
119119 -name :Publish to NPM
120- run :npm publish --tag $(cat. tag)
120+ run :npm publish --tag $(catpublish- tag.txt )
121121 -uses :actions/setup-node@v3
122122with :
123- node-version :' 18 .x'
123+ node-version :' 22 .x'
124124registry-url :' https://npm.pkg.github.com'
125125 -name :Configure NPM version
126126env :
127127NODE_AUTH_TOKEN :${{ secrets.GITHUB_TOKEN }}
128128run :|
129- rm -f .npmrc
130- touch .npmrc
131- echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
132- echo "@rtfpessoa:registry=https://npm.pkg.github.com/" >> .npmrc
133- echo "access=public" >> .npmrc
134- echo "save-exact=true" >> .npmrc
129+ rm -f .npmrc
130+ touch .npmrc
131+ echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
132+ echo "@rtfpessoa:registry=https://npm.pkg.github.com/" >> .npmrc
133+ echo "access=public" >> .npmrc
134+ echo "save-exact=true" >> .npmrc
135135 -name :Publish to GPR
136136run :|
137- # HACK: Override npm package name to be able to publish in GitHub
138- sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json
139- echo "Going to publish version $(cat. version) to GitHub"
140- npm publish --tag $(cat. tag)
141- # HACK: Restore npm package name
142- sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
137+ # HACK: Override npm package name to be able to publish in GitHub
138+ sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json
139+ echo "Going to publish version $(catnext- version.txt ) to GitHub"
140+ npm publish --tag $(catpublish- tag.txt )
141+ # HACK: Restore npm package name
142+ sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
143143 -name :Upload docs
144144uses :actions/upload-artifact@v3
145145with :