25
25
run : |
26
26
export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)"
27
27
echo "Next version is ${NEXT_VERSION}"
28
- echo "${NEXT_VERSION}" > . version
28
+ echo "${NEXT_VERSION}" > next- version.txt
29
29
echo "version=${NEXT_VERSION}" >> $GITHUB_ENV
30
30
- name : Get next npm tag name
31
31
run : |
@@ -37,22 +37,22 @@ jobs:
37
37
export PUBLISH_TAG="pr"
38
38
fi
39
39
echo "Next tag is ${PUBLISH_TAG}"
40
- echo "${PUBLISH_TAG}" > . tag
40
+ echo "${PUBLISH_TAG}" > publish- tag.txt
41
41
- name : Upload versions
42
42
uses : actions/upload-artifact@v3
43
43
with :
44
44
name : versions
45
45
if-no-files-found : error
46
46
path : |
47
- . version
48
- . tag
47
+ next- version.txt
48
+ publish- tag.txt
49
49
50
50
build :
51
51
runs-on : ubuntu-latest
52
52
needs : [version]
53
53
strategy :
54
54
matrix :
55
- node-version : [16.x, 18.x, 20.x]
55
+ node-version : [16.x, 18.x, 20.x, 22.x ]
56
56
steps :
57
57
- uses : actions/checkout@v3
58
58
with :
64
64
cache : ' npm'
65
65
- name : Log environment setup
66
66
run : |
67
- node -v
68
- npm -v
67
+ node -v
68
+ npm -v
69
69
- name : Install dependencies
70
70
run : npm install
71
71
- name : Build templates
@@ -86,60 +86,60 @@ jobs:
86
86
with :
87
87
name : versions
88
88
- name : Store version
89
- run : echo "version=$(cat . version)" >> $GITHUB_ENV
89
+ run : echo "version=$(cat next- version.txt )" >> $GITHUB_ENV
90
90
- name : Configure Git
91
91
run : |
92
- git config user.email "[email protected] "
93
- git config user.name "GitHub Actions"
92
+ git config user.email "[email protected] "
93
+ git config user.name "GitHub Actions"
94
94
- name : Tag commit
95
95
96
96
with :
97
- repo-token : " ${{ secrets.GITHUB_TOKEN }}"
98
- tag : " ${{ env.version }}"
97
+ repo-token : ' ${{ secrets.GITHUB_TOKEN }}'
98
+ tag : ' ${{ env.version }}'
99
99
- name : Install dependencies
100
100
run : npm install
101
101
- uses : actions/setup-node@v3
102
102
with :
103
103
registry-url : ' https://registry.npmjs.org'
104
- node-version : ' 18 .x'
104
+ node-version : ' 22 .x'
105
105
- name : Configure NPM version
106
106
env :
107
107
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
108
108
run : |
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
115
115
- name : Version package
116
116
run : |
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 $(cat next- version.txt ) -m "Release version %s"
119
119
- name : Publish to NPM
120
- run : npm publish --tag $(cat . tag)
120
+ run : npm publish --tag $(cat publish- tag.txt )
121
121
- uses : actions/setup-node@v3
122
122
with :
123
- node-version : ' 18 .x'
123
+ node-version : ' 22 .x'
124
124
registry-url : ' https://npm.pkg.github.com'
125
125
- name : Configure NPM version
126
126
env :
127
127
NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128
128
run : |
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
135
135
- name : Publish to GPR
136
136
run : |
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 $(cat next- version.txt ) to GitHub"
140
+ npm publish --tag $(cat publish- tag.txt )
141
+ # HACK: Restore npm package name
142
+ sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
143
143
- name : Upload docs
144
144
uses : actions/upload-artifact@v3
145
145
with :
0 commit comments