File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,8 @@ jobs:
181
181
run : yarn publish:npm:dev
182
182
env :
183
183
TAG : ${{ github.event.number }}-${{ github.event.pull_request.head.sha }}
184
+ # We tag with the GitHub PR number
185
+ NPM_TAG : ${ github.event.number }
184
186
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
185
187
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
186
188
Original file line number Diff line number Diff line change 20
20
- name : Run ./ci/steps/publish-npm-dev.sh
21
21
run : ./ci/steps/publish-npm-dev.sh
22
22
env :
23
- TAG : " beta "
23
+ TAG : ${{ github.event.number }}-${{ github.event.pull_request.head.sha }}
24
24
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
25
+ NPM_TAG : " beta"
25
26
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ main() {
6
6
source ./ci/lib.sh
7
7
source ./ci/steps/steps-lib.sh
8
8
9
+ # We need VERSION to update the package.json
10
+ if ! is_env_var_set " TAG" ; then
11
+ echo " TAG is not set. Cannot publish to npm without setting a tag."
12
+ exit 1
13
+ fi
14
+
9
15
# We need TAG to know what to publish under on npm
10
16
if ! is_env_var_set " TAG" ; then
11
17
echo " TAG is not set. Cannot publish to npm without setting a tag."
@@ -24,6 +30,11 @@ main() {
24
30
exit 1
25
31
fi
26
32
33
+ if ! is_env_var_set " NPM_TAG" ; then
34
+ echo " NPM_TAG is not set. This is needed for tagging the npm release."
35
+ exit 1
36
+ fi
37
+
27
38
echo " using tag: $TAG "
28
39
29
40
if [[ ${CI-} ]]; then
@@ -41,7 +52,12 @@ main() {
41
52
# There are two things that need to happen
42
53
# in order to publish on npm, we need to change the version
43
54
# and possibly change the tag
44
- yarn publish --non-interactive release --tag " $TAG "
55
+ pushd release
56
+ # This modifes the version in the package.json
57
+ npm version " $VERSION -$TAG "
58
+ popd
59
+
60
+ yarn publish --non-interactive release --tag " $NPM_TAG "
45
61
}
46
62
47
63
main " $@ "
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " code-server" ,
3
3
"license" : " MIT" ,
4
- "version" : " 4.0.1-4769-cbb934c72ccf101aebb6827af4a045ac9063a911 " ,
4
+ "version" : " 4.0.1" ,
5
5
"description" : " Run VS Code on a remote server." ,
6
6
"homepage" : " https://github.com/cdr/code-server" ,
7
7
"bugs" : {
You can’t perform that action at this time.
0 commit comments