Skip to content

Commit

Permalink
Merge pull request #35 from zowe/update-workflows-v1
Browse files Browse the repository at this point in the history
Port workflow updates from master to zowe-v1-lts
  • Loading branch information
awharn authored Mar 28, 2023
2 parents aaa4a9d + 372305d commit 5e84a69
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: ./.github/resources/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js LTS
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Install Node Package Dependencies
run: npm i

- name: Lint
run: npm run lint
run: npm run lint
63 changes: 23 additions & 40 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js LTS
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: lts/*

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Get Zowe version
id: get-version
if: ${{ steps.get-version-from-workflow.outcome == 'skipped' }}
run: echo "::set-output name=number::$(echo 'CLI_v'$(npx zowe --version))"
run: echo "number=$(echo 'CLI_v'$(npx zowe --version))" >> $GITHUB_OUTPUT

- name: Build Web Help
id: build
Expand All @@ -86,55 +86,38 @@ jobs:
- name: Archive Results
id: upload
if: ${{ always() && steps.build.outcome == 'success' }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: results
path: |
generatedWebHelp/
zowe.pdf
- name: Create Release
id: release-create
if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/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' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
release_name: ${{ github.event.inputs.zowe-version }}
tag_name: ${{ github.event.inputs.zowe-version }}
body: |
Zowe CLI Web-Help for Zowe Release ${{ github.event.inputs.zowe-version }}
- name: Prepare Release Artifacts
id: release-prepare
if: ${{ steps.release-create.outcome == 'success' }}
if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/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' }}
run: |
mkdir release
mv zowe.pdf release/.
mv generatedWebHelp release/.
cd release
mv "generatedWebHelp" "zowe-${{ github.event.inputs.zowe-version }}-WebHelp"
mv "zowe.pdf" "zowe-${{ github.event.inputs.zowe-version }}.pdf"
zip -r "zowe-${{ github.event.inputs.zowe-version }}-WebHelp.zip" "zowe-${{ github.event.inputs.zowe-version }}-WebHelp"
TZ=UTC find . -exec touch -t 197001010000.00 {} +
zip -roX "zowe-${{ github.event.inputs.zowe-version }}-WebHelp.zip" "zowe-${{ github.event.inputs.zowe-version }}-WebHelp"
TZ=UTC touch -t 197001010000.00 zowe-${{ github.event.inputs.zowe-version }}-WebHelp.zip
- name: Upload Release Artifacts - PDF
id: release-upload-pdf
if: ${{ steps.release-prepare.outcome == 'success' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release-create.outputs.upload_url }}
asset_path: ./zowe-${{ github.event.inputs.zowe-version }}.pdf
asset_name: zowe-${{ github.event.inputs.zowe-version }}.pdf
asset_content_type: application/pdf

- name: Upload Release Artifacts - ZIP
id: release-upload-zip
- name: Create Release
id: release-create
if: ${{ steps.release-prepare.outcome == 'success' }}
uses: actions/upload-release-asset@v1
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release-create.outputs.upload_url }}
asset_path: ./zowe-${{ github.event.inputs.zowe-version }}-WebHelp.zip
asset_name: zowe-${{ github.event.inputs.zowe-version }}-WebHelp.zip
asset_content_type: application/zip
draft: false
prerelease: false
name: ${{ github.event.inputs.zowe-version }}
tag: ${{ github.event.inputs.zowe-version }}
body: |
Zowe CLI Web-Help for Zowe Release ${{ github.event.inputs.zowe-version }}
artifacts: "release/zowe-${{ github.event.inputs.zowe-version }}.pdf,release/zowe-${{ github.event.inputs.zowe-version }}-WebHelp.zip"
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js LTS
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: lts/*

Expand All @@ -44,9 +44,8 @@ jobs:
- name: Get Zowe version
id: get-version
if: ${{ steps.get-version-from-workflow.outcome == 'skipped' }}
run: |
echo "::set-output name=number::$(echo 'CLI_v'$(zowe --version))"
echo "number=$(echo 'CLI_v'$(npx zowe --version))" >> $GITHUB_OUTPUT
- name: Setup zowe.json file
id: setup
Expand Down Expand Up @@ -77,7 +76,7 @@ jobs:
- name: Archive Results
id: upload
if: ${{ always() && steps.build.outcome == 'success' }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: results
path: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get Changed Files
id: files
uses: jitterbit/get-changed-files@v1
uses: tj-actions/changed-files@v35
with:
format: 'json'
files: "**/*.json"
- run: |
readarray -t all_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.all }}')"
readarray -t all_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.all_changed_files }}')"
for file in ${all_files[@]}; do
[[ ''${file}'' == *.jsonc ]] || (echo "Not a JSON file: ${file}" && exit 1)
[[ ''${file}'' == commandGroups/* ]] || [[ ''${file}'' == profiles/* ]] || (echo "Wrong location: ${file}" && exit 1)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ zowe.json
tsconfig.tsbuildinfo
package-lock.json
.copyright
*.bak

0 comments on commit 5e84a69

Please sign in to comment.