Skip to content

Zowe CLI Deploy Component #176

Zowe CLI Deploy Component

Zowe CLI Deploy Component #176

name: Zowe CLI Deploy Component
on:
workflow_call:
inputs:
pkg-name:
required: true
type: string
pkg-tags:
required: true
type: string
secrets:
NPM_PUBLIC_TOKEN:
required: true
workflow_dispatch:
inputs:
pkg-name:
description: "Name of the package to be deployed (the @zowe scope will be prepended)"
default: "cli"
required: true
pkg-tags:
description: "Tags to be distributed from Artifactory (separate multiple by spaces)"
default: "latest"
required: true
permissions:
issues: write
jobs:
deploy:
runs-on: ubuntu-latest
env:
PKG_NAME: ${{ inputs.pkg-name }}
PKG_TAGS: ${{ inputs.pkg-tags }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'zowe/zowe-cli-standalone-package'
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: ${{ (!env.ACT && 'npm') || '' }}
# Python 3.12 breaks node-gyp < 10, breaking current versions of Node 18/20 (as of Nov 9, 2023) - awharn
- name: Downgrade Python
uses: actions/setup-python@v5
with:
python-version: '3.11.5'
- name: Install Dependencies
run: npm ci
- name: NPM Login
run: bash scripts/npm_login.sh ${{ env.NPM_REGISTRY || 'https://registry.npmjs.org/' }}
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLIC_TOKEN }}
- name: Deploy Package
id: deploy
run: node scripts/deploy-component.js ${{ env.PKG_NAME }} ${{ env.PKG_TAGS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Issue
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
ERROR_REPORT: ${{ steps.deploy.outputs.errors }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
filename: .github/deploy-failed.md
update_existing: true