From 1915aef077b8394bf52fb9a59990adea41b889a8 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Tue, 24 Sep 2024 14:51:02 -0400 Subject: [PATCH] Update GH workflows to prepare for V3 Signed-off-by: Timothy Johnson --- .github/workflows/codeql.yml | 6 +++--- .github/workflows/cron.yml | 21 +++++++-------------- .github/workflows/main.yml | 16 ++++++++-------- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2278aae..d58aaf5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,11 +4,11 @@ on: push: branches: - master - - zowe-v1-lts + - zowe-v?-lts pull_request: branches: - master - - zowe-v1-lts + - zowe-v?-lts jobs: analyze: @@ -35,4 +35,4 @@ jobs: config-file: ./.github/resources/codeql-config.yml - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 \ No newline at end of file + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index bd1a913..53bfd61 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -6,27 +6,20 @@ env: GITHUB_TOKEN: ${{ secrets.ZOWE_ROBOT_TOKEN }} jobs: - v1-lts: + test: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Test Scripts - run: gh workflow run -r zowe-v1-lts test.yml - - - name: WebHelp CI - run: gh workflow run -r zowe-v1-lts -f release=false main.yml + strategy: + fail-fast: false + matrix: + branch: ['master', 'zowe-v1-lts', 'zowe-v2-lts'] - v2-lts: - runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Test Scripts - run: gh workflow run -r master test.yml + run: gh workflow run -r ${{ matrix.branch }} test.yml - name: WebHelp CI - run: gh workflow run -r master -f release=false main.yml - \ No newline at end of file + run: gh workflow run -r ${{ matrix.branch }} -f release=false main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75ea70b..906438f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,7 @@ on: push: branches: - master - - zowe-v1-lts + - zowe-v?-lts pull_request_target: workflow_dispatch: inputs: @@ -41,7 +41,7 @@ jobs: - name: Install Node Package Dependencies id: install-node - run: | + run: | npm i --prod npm install -g puppeteer-cli @@ -73,7 +73,7 @@ jobs: zowe plugins install @zowe/ims-for-zowe-cli@zowe-v2-lts zowe plugins install @zowe/mq-for-zowe-cli@zowe-v2-lts zowe plugins install @zowe/zos-ftp-for-zowe-cli@zowe-v2-lts - + - name: Get Zowe version id: get-version if: ${{ steps.get-version-from-workflow.outcome == 'skipped' }} @@ -97,10 +97,10 @@ jobs: path: | generatedWebHelp/ zowe.pdf - + - name: Prepare Release Artifacts id: release-prepare - if: ${{ (github.ref_name == 'master' || github.ref_name == 'zowe-v1-lts') && steps.build.outcome == 'success' && github.event_name == 'workflow_dispatch' && github.event.inputs.zowe-version && github.event.inputs.zowe-version != '' && github.event.inputs.release == 'true' }} + if: ${{ github.ref_protected && steps.build.outcome == 'success' && github.event_name == 'workflow_dispatch' && github.event.inputs.zowe-version && github.event.inputs.zowe-version != '' && github.event.inputs.release == 'true' }} run: | mkdir release mv zowe.pdf release/. @@ -128,7 +128,7 @@ jobs: deploy-release: needs: test runs-on: ubuntu-latest - if: ${{ needs.test.result == 'success' && github.event_name == 'workflow_dispatch' && (github.ref_name == 'master' || github.ref_name == 'zowe-v1-lts') && github.event.inputs.zowe-version && github.event.inputs.zowe-version != '' && github.event.inputs.release == 'true' }} + if: ${{ needs.test.result == 'success' && github.event_name == 'workflow_dispatch' && github.ref_protected && github.event.inputs.zowe-version && github.event.inputs.zowe-version != '' && github.event.inputs.release == 'true' }} permissions: contents: write steps: @@ -136,7 +136,7 @@ jobs: uses: actions/checkout@v4 with: ref: 'gh-pages' - + - name: Get Release Contents env: GITHUB_TOKEN: ${{ secrets.ZOWE_ROBOT_TOKEN }} @@ -158,7 +158,7 @@ jobs: deploy-artifact: needs: test runs-on: ubuntu-latest - if: needs.test.result == 'success' && github.event_name == 'push' && (github.ref_name == 'master' || github.ref_name == 'zowe-v1-lts') + if: needs.test.result == 'success' && github.event_name == 'push' && github.ref_protected permissions: contents: write steps: