From 18b48f245e02792a664f9075df8651e1fb1a8266 Mon Sep 17 00:00:00 2001 From: Katelyn Nienaber Date: Tue, 24 Aug 2021 20:58:39 +0200 Subject: [PATCH 1/4] Fix for version compare step? Signed-off-by: Katelyn Nienaber --- .github/workflows/deployment.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 51e3a85a4b..abab025e21 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -156,7 +156,12 @@ jobs: # id: check_project - name: Check version is bumped - run: "echo ::set-output name=version_bumped::$(fromJson(steps.get_version.outputs.top_package).version !== v + steps.get_gh_version.outputs.gh_version || echo $?)" + run: | + if [[ fromJson(steps.get_version.outputs.top_package).version !== v + steps.get_gh_version.outputs.gh_version ]]; then + echo "::set-output name=version_bumped::true" + else + echo "::set-output name=version_bumped::false" + fi id: check_project # Each individual action should git-add the desired files From 62d81c6ec76a57f58c445b7de37f7d107c0e7ec5 Mon Sep 17 00:00:00 2001 From: Katelyn Nienaber Date: Thu, 26 Aug 2021 09:55:51 +0200 Subject: [PATCH 2/4] Cleanup commit history & signoff Signed-off-by: Katelyn Nienaber --- .github/workflows/deployment.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index abab025e21..2470cc4e6d 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -67,6 +67,8 @@ jobs: steps: - name: Checkout the Source Code uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup NodeJS uses: actions/setup-node@v1 @@ -147,8 +149,8 @@ jobs: run: "echo ::set-output name=top_package::$(cat package.json)" id: get_version - name: Get most recent GitHub release version - run: "echo ::set-output name=gh_version::$(git describe --tags $(git rev-list --tags --max-count=1))" id: get_gh_version + uses: "WyriHaximus/github-action-get-previous-tag@v1" # Removed step because of issues with publishing # - name: Check if files were staged @@ -156,22 +158,18 @@ jobs: # id: check_project - name: Check version is bumped - run: | - if [[ fromJson(steps.get_version.outputs.top_package).version !== v + steps.get_gh_version.outputs.gh_version ]]; then - echo "::set-output name=version_bumped::true" - else - echo "::set-output name=version_bumped::false" - fi + if: ${{ !contains(steps.get_gh_version.outputs.tag, fromJson(steps.get_version.outputs.top_package).version) }} + run: echo "::set-output name=version_bumped::true" id: check_project # Each individual action should git-add the desired files - name: Update Project Files with new Version - if: steps.check_project.outputs.version_bumped == true + if: steps.check_project.outputs.version_bumped run: | git status git commit -m "Version Bumped to ${{ fromJson(steps.get_version.outputs.top_package).version }}" --signoff - name: Push changes - if: steps.check_project.outputs.version_bumped == true + if: steps.check_project.outputs.version_bumped uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -179,7 +177,7 @@ jobs: branch: ${{ github.ref }} - name: Create the Release - if: steps.check_project.outputs.version_bumped == true + if: steps.check_project.outputs.version_bumped id: create_release uses: actions/create-release@v1 env: @@ -197,9 +195,8 @@ jobs: - name: Upload the Zowe Explorer Assets if: | - steps.check_project.outputs.version_bumped == true && + steps.check_project.outputs.version_bumped && steps.deploy_zowe_explorer.outputs.archive != null - # steps.check_project.outputs.version_bumped == true || github.event.input.create_release == 'true') && uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -211,9 +208,8 @@ jobs: - name: Upload the FTP Extension for Zowe Explorer Assets if: | - steps.check_project.outputs.version_bumped == true && + steps.check_project.outputs.version_bumped && steps.deploy_zowe_explorer_ftp_extension.outputs.archive != null - # steps.check_project.outputs.version_bumped == true || github.event.input.create_release == 'true') && uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -225,9 +221,8 @@ jobs: - name: Upload the Zowe Explorer APIs Assets if: | - steps.check_project.outputs.version_bumped == true && + steps.check_project.outputs.version_bumped && steps.deploy_zowe_explorer_api.outputs.archive != null - # steps.check_project.outputs.version_bumped == true || github.event.input.create_release == 'true') && uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -239,9 +234,8 @@ jobs: - name: Upload the ESLint plugin for Zowe Explorer Assets if: | - steps.check_project.outputs.version_bumped == true && + steps.check_project.outputs.version_bumped && steps.deploy_eslint_plugin_zowe_explorer.outputs.archive != null - # steps.check_project.outputs.version_bumped == true || github.event.input.create_release == 'true') && uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7719c3f7000c898621b3203413f2994fb5ed295a Mon Sep 17 00:00:00 2001 From: Katelyn Nienaber Date: Thu, 26 Aug 2021 14:15:23 +0200 Subject: [PATCH 3/4] Fixes for Fernando Signed-off-by: Katelyn Nienaber --- .github/workflows/deployment.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2470cc4e6d..be3cca4131 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -162,20 +162,6 @@ jobs: run: echo "::set-output name=version_bumped::true" id: check_project - # Each individual action should git-add the desired files - - name: Update Project Files with new Version - if: steps.check_project.outputs.version_bumped - run: | - git status - git commit -m "Version Bumped to ${{ fromJson(steps.get_version.outputs.top_package).version }}" --signoff - - name: Push changes - if: steps.check_project.outputs.version_bumped - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - force: true - branch: ${{ github.ref }} - - name: Create the Release if: steps.check_project.outputs.version_bumped id: create_release From 4b96660d4d1c2bd3922dbe9b02a6a36497920488 Mon Sep 17 00:00:00 2001 From: Katelyn Nienaber Date: Thu, 26 Aug 2021 14:48:11 +0200 Subject: [PATCH 4/4] Make the darn thing upload the VSIX Signed-off-by: Katelyn Nienaber --- .github/workflows/deployment.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index be3cca4131..2d254f7c35 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -180,9 +180,7 @@ jobs: prerelease: false - name: Upload the Zowe Explorer Assets - if: | - steps.check_project.outputs.version_bumped && - steps.deploy_zowe_explorer.outputs.archive != null + if: steps.check_project.outputs.version_bumped uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -193,9 +191,7 @@ jobs: asset_content_type: application/octet-stream - name: Upload the FTP Extension for Zowe Explorer Assets - if: | - steps.check_project.outputs.version_bumped && - steps.deploy_zowe_explorer_ftp_extension.outputs.archive != null + if: steps.check_project.outputs.version_bumped uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -206,9 +202,7 @@ jobs: asset_content_type: application/octet-stream - name: Upload the Zowe Explorer APIs Assets - if: | - steps.check_project.outputs.version_bumped && - steps.deploy_zowe_explorer_api.outputs.archive != null + if: steps.check_project.outputs.version_bumped uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -219,9 +213,7 @@ jobs: asset_content_type: application/octet-stream - name: Upload the ESLint plugin for Zowe Explorer Assets - if: | - steps.check_project.outputs.version_bumped && - steps.deploy_eslint_plugin_zowe_explorer.outputs.archive != null + if: steps.check_project.outputs.version_bumped uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}