Skip to content

Commit e6ceacf

Browse files
committed
feat: move npm publish job to ci.yaml
1 parent c20b0b3 commit e6ceacf

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,23 @@ jobs:
177177
name: npm-package
178178
path: ./package.tar.gz
179179

180+
npm:
181+
# the npm-package gets uploaded as an artifact in Build
182+
# so we need that to complete before this runs
183+
needs: build
184+
# This environment "npm" requires someone from
185+
# coder/code-server-reviewers to approve the PR before this job runs.
186+
environment: npm
187+
runs-on: ubuntu-latest
188+
steps:
189+
- uses: actions/checkout@v2
190+
191+
- name: Run ./ci/steps/publish-npm.sh
192+
run: yarn publish:npm
193+
env:
194+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
195+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
196+
180197
# TODO: cache building yarn --production
181198
# possibly 2m30s of savings(?)
182199
# this requires refactoring our release scripts

.github/workflows/npm-brew.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ jobs:
1919
- name: Publish npm package and tag with "latest"
2020
run: yarn publish:npm
2121
env:
22-
ENVIRONMENT: "production"
2322
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2423
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25-
NPM_TAG: "latest"
2624

2725
homebrew:
2826
# The newest version of code-server needs to be available on npm when this runs

.github/workflows/npm-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v2
2222

23-
- name: Run ./ci/steps/publish-npm.sh
23+
- name: Publish npm-package
2424
run: yarn publish:npm
2525
env:
2626
ENVIRONMENT: "development"

ci/steps/publish-npm.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
# TODOs refactor this to determine ENVIRONMENT, NPM_TAG and NPM_VERSION
5+
46
main() {
57
cd "$(dirname "$0")/../.."
68
source ./ci/lib.sh

0 commit comments

Comments
 (0)