forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.72 KB
/
cluster-ui-release-next.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Publish Cluster UI Pre-release
on:
push:
branches:
- master
paths:
- 'pkg/ui/workspaces/cluster-ui/**/*.tsx?'
- 'pkg/ui/workspaces/cluster-ui/yarn.lock'
- 'pkg/ui/workspaces/cluster-ui/package.json'
jobs:
publish_cluster_ui:
if: github.repository == 'cockroachdb/cockroach'
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkg/ui/workspaces/cluster-ui
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Bazel Cache
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-bazel-cache
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
cache-dependency-path: pkg/ui/workspaces/cluster-ui/yarn.lock
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check if version is published
id: version-check
shell: bash
run: |
PACKAGE_VERSION=$(cat ./package.json | jq -r ".version");
VERSIONS=$(npm view @cockroachlabs/cluster-ui versions)
if [[ $VERSIONS == *"$PACKAGE_VERSION"* ]]; then
echo "published=yes" >> $GITHUB_OUTPUT
echo
echo "🛑 Cluster UI package version $PACKAGE_VERSION is already published"
echo "to npm. Publishing step should be skipped. 🛑"
else
echo "published=no" >> $GITHUB_OUTPUT
fi
- name: Build Cluster UI
run: |
yarn install --frozen-lockfile
bazel build //pkg/ui/workspaces/cluster-ui:cluster-ui
- name: Publish prerelease version
if: steps.version-check.outputs.published == 'no'
run: npm publish --access public --tag next --dry-run