File tree 4 files changed +38
-17
lines changed
4 files changed +38
-17
lines changed Original file line number Diff line number Diff line change @@ -177,15 +177,6 @@ jobs:
177
177
name : npm-package
178
178
path : ./package.tar.gz
179
179
180
- - name : Publish npm package with PR number and commit SHA
181
- run : yarn publish:npm
182
- env :
183
- ENVIRONMENT : " development"
184
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
185
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
186
- NPM_TAG : ${{ github.event.number }}
187
- PR_NUMBER_AND_COMMIT_SHA : ${{ github.event.number }}-${{ github.event.pull_request.head.sha }}
188
-
189
180
# TODO: cache building yarn --production
190
181
# possibly 2m30s of savings(?)
191
182
# this requires refactoring our release scripts
Original file line number Diff line number Diff line change
1
+ name : Publish on npm and tag with "beta"
2
+
3
+ on :
4
+ # Shows the manual trigger in GitHub UI
5
+ # helpful as a back-up in case the GitHub Actions Workflow fails
6
+ workflow_dispatch :
7
+
8
+ push :
9
+ branches :
10
+ - main
11
+
12
+ jobs :
13
+ # NOTE: this job requires curl, jq and yarn
14
+ # All of them are included in ubuntu-latest.
15
+ npm :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - uses : actions/checkout@v2
19
+
20
+ - name : Publish npm package and tag "beta"
21
+ run : yarn publish:npm
22
+ env :
23
+ ENVIRONMENT : " staging"
24
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
25
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
26
+ NPM_TAG : " beta"
27
+ # Since this only runs on a merge into main, we can't use github.event.number
28
+ # so we instead use the word "beta" and the PR merge commit SHA
29
+ PR_NUMBER_AND_COMMIT_SHA : beta-${{ github.sha }}
Original file line number Diff line number Diff line change 16
16
steps :
17
17
- uses : actions/checkout@v2
18
18
19
- - name : Publish npm package with PR number and commit SHA
19
+ - name : Publish npm package and tag with "latest"
20
20
run : yarn publish:npm
21
21
env :
22
22
ENVIRONMENT : " production"
Original file line number Diff line number Diff line change 1
- name : Publish on npm and tag with "beta"
1
+ name : Publish on npm and tag with PR number
2
2
3
3
on :
4
4
# Shows the manual trigger in GitHub UI
5
5
# helpful as a back-up in case the GitHub Actions Workflow fails
6
6
workflow_dispatch :
7
7
8
- push :
8
+ pull_request :
9
9
branches :
10
10
- main
11
11
12
12
jobs :
13
13
# NOTE: this job requires curl, jq and yarn
14
14
# All of them are included in ubuntu-latest.
15
15
npm :
16
+ # This environment "npm" requires someone from
17
+ # coder/code-server-reviewers to approve the PR before this job runs.
18
+ environment : npm
16
19
runs-on : ubuntu-latest
17
20
steps :
18
21
- uses : actions/checkout@v2
19
22
20
23
- name : Run ./ci/steps/publish-npm.sh
21
24
run : yarn publish:npm
22
25
env :
23
- ENVIRONMENT : " staging "
26
+ ENVIRONMENT : " development "
24
27
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
25
28
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
26
- NPM_TAG : " beta"
27
- # Since this only runs on a merge into main, we can't use github.event.number
28
- # so we instead use the word "beta" and the PR merge commit SHA
29
- PR_NUMBER_AND_COMMIT_SHA : beta-${{ github.sha }}
29
+ NPM_TAG : ${{ github.event.number }}
30
+ PR_NUMBER_AND_COMMIT_SHA : ${{ github.event.number }}-${{ github.event.pull_request.head.sha }}
You can’t perform that action at this time.
0 commit comments