-
Notifications
You must be signed in to change notification settings - Fork 268
92 lines (80 loc) · 2.55 KB
/
release-shell-pkg.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Publish Shell Package
on:
push:
tags:
- 'shell-pkg-v*'
- 'creators-pkg-v*'
workflow_call:
inputs:
tag:
required: false
type: string
is_test:
required: false
type: string
test_branch:
required: false
type: string
outputs:
build-release-shell-creators-status:
value: ${{ jobs.build.outputs.build-status }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
if: github.repository == 'rancher/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}'))
outputs:
build-status: ${{ job.status }}
steps:
- if: inputs.is_test == 'true' && inputs.test_branch != ''
name: Checkout (test flow)
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ inputs.test_branch }}
fetch-depth: 0
- if: inputs.is_test != 'true'
name: Checkout (normal flow)
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Check Tags Version Matching
env:
TAG: ${{ inputs.tag || github.ref_name }}
run: ./.github/workflows/scripts/check-package-tag-version.sh
shell: bash
- name: Validate Plugin build system
run: ./shell/scripts/test-plugins-build.sh
shell: bash
# Reset the local (ci) repository state because
# The previous step (Validate Plugin build system) changes
# the version number on package.json for Shell in order
# to release it in verdaccio for it's tests
- name: Reset repository (file system)
run: |
git reset --hard HEAD
echo $NPM_REGISTRY
cat ./shell/package.json
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
scope: '@rancher'
- name: Install packages
run: yarn install --frozen-lockfile
- name: Publish Shell Package to npm
run: ./shell/scripts/publish-shell.sh --npm
env:
TAG: ${{ inputs.tag || github.ref_name }}
DRY_RUN: ${{ inputs.is_test }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}