Skip to content

Commit a98cbe7

Browse files
committed
plz work
1 parent 5da9bc9 commit a98cbe7

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ jobs:
181181
run: yarn publish:npm:dev
182182
env:
183183
TAG: ${{ github.event.number }}-${{ github.event.pull_request.head.sha }}
184+
# We tag with the GitHub PR number
185+
NPM_TAG: ${ github.event.number }
184186
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
185187
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
186188

.github/workflows/npm-dev.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- name: Run ./ci/steps/publish-npm-dev.sh
2121
run: ./ci/steps/publish-npm-dev.sh
2222
env:
23-
TAG: "beta"
23+
TAG: ${{ github.event.number }}-${{ github.event.pull_request.head.sha }}
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
NPM_TAG: "beta"
2526
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

ci/steps/publish-npm-dev.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ main() {
66
source ./ci/lib.sh
77
source ./ci/steps/steps-lib.sh
88

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+
915
# We need TAG to know what to publish under on npm
1016
if ! is_env_var_set "TAG"; then
1117
echo "TAG is not set. Cannot publish to npm without setting a tag."
@@ -24,6 +30,11 @@ main() {
2430
exit 1
2531
fi
2632

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+
2738
echo "using tag: $TAG"
2839

2940
if [[ ${CI-} ]]; then
@@ -41,7 +52,12 @@ main() {
4152
# There are two things that need to happen
4253
# in order to publish on npm, we need to change the version
4354
# 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"
4561
}
4662

4763
main "$@"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-server",
33
"license": "MIT",
4-
"version": "4.0.1-4769-cbb934c72ccf101aebb6827af4a045ac9063a911",
4+
"version": "4.0.1",
55
"description": "Run VS Code on a remote server.",
66
"homepage": "https://github.com/cdr/code-server",
77
"bugs": {

0 commit comments

Comments
 (0)