File tree Expand file tree Collapse file tree 4 files changed +38
-17
lines changed Expand file tree Collapse file tree 4 files changed +38
-17
lines changed Original file line number Diff line number Diff line change @@ -177,15 +177,6 @@ jobs:
177177 name : npm-package
178178 path : ./package.tar.gz
179179
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-
189180 # TODO: cache building yarn --production
190181 # possibly 2m30s of savings(?)
191182 # 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 1616 steps :
1717 - uses : actions/checkout@v2
1818
19- - name : Publish npm package with PR number and commit SHA
19+ - name : Publish npm package and tag with "latest"
2020 run : yarn publish:npm
2121 env :
2222 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
22
33on :
44 # Shows the manual trigger in GitHub UI
55 # helpful as a back-up in case the GitHub Actions Workflow fails
66 workflow_dispatch :
77
8- push :
8+ pull_request :
99 branches :
1010 - main
1111
1212jobs :
1313 # NOTE: this job requires curl, jq and yarn
1414 # All of them are included in ubuntu-latest.
1515 npm :
16+ # This environment "npm" requires someone from
17+ # coder/code-server-reviewers to approve the PR before this job runs.
18+ environment : npm
1619 runs-on : ubuntu-latest
1720 steps :
1821 - uses : actions/checkout@v2
1922
2023 - name : Run ./ci/steps/publish-npm.sh
2124 run : yarn publish:npm
2225 env :
23- ENVIRONMENT : " staging "
26+ ENVIRONMENT : " development "
2427 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2528 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