Skip to content

[release-2.8] add missing types for extensions (#12954) #84

[release-2.8] add missing types for extensions (#12954)

[release-2.8] add missing types for extensions (#12954) #84

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: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
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
# Skipping due to node version mismatch
# - 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: "16.x"
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 }}