Skip to content

Commit d775c88

Browse files
committed
placeholder commit message
1 parent 6e04501 commit d775c88

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/npm-dev.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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: Run ./ci/steps/publish-npm-dev.sh
21+
run: ./ci/steps/publish-npm-dev.sh
22+
env:
23+
TAG: "beta"
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

ci/steps/publish-npm-dev.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
main() {
5+
# We need VERSION to bump the brew formula
6+
if ! is_env_var_set "TAG"; then
7+
echo "TAG is not set. Cannot publish to npm without setting a tag"
8+
exit 1
9+
fi
10+
cd "$(dirname "$0")/../.."
11+
source ./ci/lib.sh
12+
13+
if [[ ${CI-} ]]; then
14+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
15+
fi
16+
17+
download_artifact npm-package ./release-npm-package
18+
# https://github.com/actions/upload-artifact/issues/38
19+
tar -xzf release-npm-package/package.tar.gz
20+
21+
# Ignore symlink when publishing npm package
22+
# See: https://github.com/cdr/code-server/pull/3935
23+
echo "node_modules.asar" > release/.npmignore
24+
yarn publish --non-interactive release --tag "$TAG"
25+
}
26+
27+
main "$@"

0 commit comments

Comments
 (0)