Zowe CLI Bundle #341
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Zowe CLI Bundle | |
on: | |
workflow_call: | |
inputs: | |
dry-run: | |
required: true | |
type: boolean | |
package-tag: | |
required: true | |
type: string | |
release-type: | |
required: true | |
type: string | |
secrets: | |
JF_ARTIFACTORY_TOKEN: | |
required: true | |
workflow_dispatch: | |
inputs: | |
package-tag: | |
description: "Specify package tag to bundle" | |
default: zowe-v2-lts | |
required: true | |
type: choice | |
options: | |
- zowe-v1-lts | |
- zowe-v2-lts | |
# - next | |
release-type: | |
description: "Specify type of deployment" | |
default: snapshot | |
required: true | |
type: choice | |
options: | |
- release | |
- snapshot | |
dry-run: | |
description: "Check to skip publishing to Artifactory" | |
default: false | |
required: false | |
type: boolean | |
license-version: | |
description: "Override version of Zowe Licenses ZIP" | |
required: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Install NPM 8 | |
run: npm install -g [email protected] | |
- name: Install Dependencies | |
run: npm ci | |
- name: Load Zowe Versions | |
id: versions | |
run: node scripts/load-zowe-versions.js ${{ github.event.inputs.package-tag || inputs.package-tag }} ${{ github.event.inputs.release-type || inputs.release-type }} | |
env: | |
GIT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
- name: Setup JFrog CLI | |
uses: jfrog/setup-jfrog-cli@v3 | |
env: | |
JF_ENV_1: ${{ secrets.JF_ARTIFACTORY_TOKEN }} | |
- name: Download Zowe License ZIP | |
run: | | |
if [[ "${{ github.event.inputs.package-tag || inputs.package-tag }}" != "next" ]]; then | |
jfrog rt dl --flat --fail-no-op libs-release-local/org/zowe/licenses/${{ github.event.inputs.license-version || steps.versions.outputs.tags_version }}/zowe_licenses_cli.zip /tmp/ | |
else | |
jfrog rt dl --flat --fail-no-op libs-snapshot-local/org/zowe/licenses/${{ steps.versions.outputs.tags_version }}-next-SNAPSHOT/zowe_licenses_cli-SNAPSHOT.zip /tmp/ | |
mv /tmp/zowe_licenses_cli-SNAPSHOT.zip /tmp/zowe_licenses_cli.zip | |
fi | |
- name: Create CLI Core Bundle | |
run: | | |
mkdir -p temp && cd temp | |
mkdir -p licenses && cd licenses && cp /tmp/zowe_licenses_cli.zip zowe_licenses_cli.zip && cd .. | |
npm pack @zowe/cli@${{ steps.versions.outputs.packages_cli }} | |
if [[ "${{ github.event.inputs.package-tag || inputs.package-tag }}" == "zowe-v1-lts" ]]; then | |
npm pack @zowe/secure-credential-store-for-zowe-cli@${{ steps.versions.outputs.packages_secure-credential-store-for-zowe-cli }} | |
fi | |
bash ../scripts/repackage_bundle.sh *.tgz | |
mv zowe-cli-package.zip ../zowe-cli-package-${{ env.BUNDLE_VERSION }}.zip | |
rm -rf * | |
- name: Create CLI Plugins Bundle | |
run: | | |
mkdir -p temp && cd temp | |
mkdir -p licenses && cd licenses && cp /tmp/zowe_licenses_cli.zip zowe_licenses_cli.zip && cd .. | |
npm pack @zowe/cics-for-zowe-cli@${{ steps.versions.outputs.packages_cics-for-zowe-cli }} | |
npm pack @zowe/db2-for-zowe-cli@${{ steps.versions.outputs.packages_db2-for-zowe-cli }} | |
npm pack @zowe/ims-for-zowe-cli@${{ steps.versions.outputs.packages_ims-for-zowe-cli }} | |
npm pack @zowe/mq-for-zowe-cli@${{ steps.versions.outputs.packages_mq-for-zowe-cli }} | |
npm pack @zowe/zos-ftp-for-zowe-cli@${{ steps.versions.outputs.packages_zos-ftp-for-zowe-cli }} | |
bash ../scripts/repackage_bundle.sh *.tgz | |
mv zowe-cli-package.zip ../zowe-cli-plugins-${{ env.BUNDLE_VERSION }}.zip | |
rm -rf * | |
- name: Create Node.js SDK Bundle | |
run: | | |
mkdir -p temp && cd temp | |
mkdir -p licenses && cd licenses && cp /tmp/zowe_licenses_cli.zip zowe_licenses_cli.zip && cd .. | |
npm pack @zowe/imperative@${{ steps.versions.outputs.packages_imperative }} | |
npm pack @zowe/core-for-zowe-sdk@${{ steps.versions.outputs.package_core-for-zowe-sdk }} | |
npm pack @zowe/provisioning-for-zowe-sdk@${{ steps.versions.outputs.packages_provisioning-for-zowe-sdk }} | |
npm pack @zowe/zos-console-for-zowe-sdk@${{ steps.versions.outputs.packages_zos-console-for-zowe-sdk }} | |
npm pack @zowe/zos-files-for-zowe-sdk@${{ steps.versions.outputs.packages_zos-files-for-zowe-sdk }} | |
npm pack @zowe/zos-jobs-for-zowe-sdk@${{ steps.versions.outputs.packages_zos-jobs-for-zowe-sdk }} | |
npm pack @zowe/zos-logs-for-zowe-sdk@${{ steps.versions.outputs.packages_zos-logs-for-zowe-sdk }} | |
npm pack @zowe/zos-tso-for-zowe-sdk@${{ steps.versions.outputs.packages_zos-tso-for-zowe-sdk }} | |
npm pack @zowe/zos-uss-for-zowe-sdk@${{ steps.versions.outputs.packages_zos-uss-for-zowe-sdk }} | |
npm pack @zowe/zos-workflows-for-zowe-sdk@${{ steps.versions.outputs.packages_zos-workflows-for-zowe-sdk }} | |
npm pack @zowe/zosmf-for-zowe-sdk@${{ steps.versions.outputs.packages_zosmf-for-zowe-sdk }} | |
bash ../scripts/repackage_bundle.sh *.tgz | |
mv zowe-cli-package.zip ../zowe-nodejs-sdk-${{ env.BUNDLE_VERSION }}.zip | |
bash ../scripts/generate_typedoc.sh ${{ env.BUNDLE_VERSION_SHORT }} \ | |
${{ steps.versions.outputs.packages_imperative }} ${{ steps.versions.outputs.packages_cli }} | |
mv zowe-node-sdk-typedoc.zip ../zowe-nodejs-sdk-typedoc-${{ env.BUNDLE_VERSION }}.zip | |
rm -rf * | |
- name: Create Python SDK Bundle | |
run: | | |
mkdir -p temp && cd temp | |
mkdir -p licenses && cd licenses && cp /tmp/zowe_licenses_cli.zip zowe_licenses_cli.zip && cd .. | |
pip3 download --no-binary=pyyaml zowe | |
TZ=UTC find . -exec touch -t 197001010000.00 {} + | |
TZ=UTC zip -roX zowe-sdk.zip * | |
mv zowe-sdk.zip ../zowe-python-sdk-${{ env.BUNDLE_VERSION }}.zip | |
rm -rf * | |
- name: Update Timestamps | |
run: TZ=UTC find . -maxdepth 1 -name "*.zip" -type f -exec touch -t 197001010000.00 {} + | |
- name: Archive Build Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: 'zowe-cli-bundle_${{ github.event.inputs.package-tag || inputs.package-tag }}' | |
path: '*.zip' | |
- name: Add Bundles to Spec | |
run: | | |
node scripts/prepare-upload.js "zowe-cli-package-${{ env.BUNDLE_VERSION }}.zip" \ | |
"libs-${{ github.event.inputs.release-type || inputs.release-type }}-local/org/zowe/cli/zowe-cli-package/${{ env.BUNDLE_VERSION_SHORT }}/" | |
node scripts/prepare-upload.js "zowe-cli-plugins-${{ env.BUNDLE_VERSION }}.zip" \ | |
"libs-${{ github.event.inputs.release-type || inputs.release-type }}-local/org/zowe/cli/zowe-cli-plugins/${{ env.BUNDLE_VERSION_SHORT }}/" | |
node scripts/prepare-upload.js "zowe-nodejs-sdk*-${{ env.BUNDLE_VERSION }}.zip" \ | |
"libs-${{ github.event.inputs.release-type || inputs.release-type }}-local/org/zowe/sdk/zowe-nodejs-sdk/${{ env.BUNDLE_VERSION_SHORT }}/" | |
node scripts/prepare-upload.js "zowe-python-sdk*-${{ env.BUNDLE_VERSION }}.zip" \ | |
"libs-${{ github.event.inputs.release-type || inputs.release-type }}-local/org/zowe/sdk/zowe-python-sdk/${{ env.BUNDLE_VERSION_SHORT }}/" | |
- name: Publish to Artifactory | |
id: publish | |
if: ${{ github.event.inputs.dry-run == 'false' || inputs.dry-run == false }} | |
run: jfrog rt u --detailed-summary --spec upload-spec.json | |
- name: Find Current PR | |
id: find-pr | |
if: ${{ steps.publish.outcome == 'success' && (github.event.inputs.release-type == 'release' || inputs.release-type == 'release') }} | |
uses: jwalton/gh-find-current-pr@v1 | |
with: | |
state: all | |
- name: Comment on PR | |
if: ${{ steps.find-pr.outputs.number }} | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
number: ${{ steps.find-pr.outputs.pr }} | |
path: summary.md | |
test: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [16.x, 18.x] | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
steps: | |
- name: Download Bundle Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: 'zowe-cli-bundle_${{ github.event.inputs.package-tag || inputs.package-tag }}' | |
path: 'zowe-cli-bundle' | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
check-latest: true | |
- name: Install CLI | |
shell: bash | |
working-directory: zowe-cli-bundle | |
run: unzip -o zowe-cli-package-*.zip && npm install -g zowe-cli.tgz | |
- name: Install Plugins | |
shell: bash | |
working-directory: zowe-cli-bundle | |
run: unzip -o zowe-cli-plugins-*.zip && zowe plugins install *-for-zowe-cli.tgz && zowe plugins validate --fail-on-error |