From 6747f6cce6b2ee39dd23b20e23e6d6abfd380b26 Mon Sep 17 00:00:00 2001 From: Vikas <84580678+vikas0212git@users.noreply.github.com> Date: Tue, 5 Oct 2021 05:24:27 -0700 Subject: [PATCH 1/6] updated vscode.yml and genAiKey.js in scripts --- .github/workflows/vscode.yml | 19 +++++++++++-------- scripts/genAiKey.js | 6 +++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index 447cf27..d70d31b 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -20,6 +20,13 @@ jobs: uses: actions/setup-node@v1 with: node-version: 16.x + - name: Check if release require + id: check-tag + run: | + echo ::set-output name=ISPRODTAG::v?[0-9]+\.[0-9]+\.[0-9]+$ + if [[ ${{ github.event.ref }} =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo ::set-output name=GITHUB_TAG::true + fi - name: npm install run: | npm install @@ -37,8 +44,7 @@ jobs: - name: GitHub Release if: | - success() && - startsWith(github.ref, 'refs/tags/') + success() && (steps.check-tag.outputs.GITHUB_TAG == 'true') uses: softprops/action-gh-release@v1 with: files: ./**/*.vsix @@ -48,14 +54,12 @@ jobs: - name: Publish to Marketplace if: | - success() && - startsWith(github.ref, 'refs/tags/') + success() && (steps.check-tag.outputs.GITHUB_TAG == 'true') run: 'vsce publish -p ${{ secrets.VSCE_TOKEN }} --packagePath *.vsix' vscode_azure_iot_edge_Stage_MacOS: name: Mac-OS - runs-on: macOS-latest - needs: [] + runs-on: macos-latest steps: - uses: actions/checkout@v2 - name: Install NodeJs @@ -73,5 +77,4 @@ jobs: node scripts/genAiKey.js echo "y" | vsce package - name: npm test - run: npm test --silent - + run: npm test --silent \ No newline at end of file diff --git a/scripts/genAiKey.js b/scripts/genAiKey.js index bdca016..4180007 100644 --- a/scripts/genAiKey.js +++ b/scripts/genAiKey.js @@ -1,7 +1,7 @@ const fs = require("fs"); -if (process.env.TRAVIS_TAG) { - const ISPROD = new RegExp(process.env.ISPRODTAG).test(process.env.TRAVIS_TAG || ""); +if (process.env.GITHUB_TAG) { + const ISPROD = new RegExp(process.env.ISPRODTAG).test(process.env.GITHUB_TAG || ""); const packageJson = JSON.parse(fs.readFileSync("package.json")); if (ISPROD) { packageJson.aiKey = process.env["PROD_AIKEY"]; @@ -12,4 +12,4 @@ if (process.env.TRAVIS_TAG) { console.log("Updated AiKey"); } else { console.log("Skipping genAiKey"); -} \ No newline at end of file +} From 6d749218f9f5118b69b975255a4c3af0877c2d8a Mon Sep 17 00:00:00 2001 From: Vikas <84580678+vikas0212git@users.noreply.github.com> Date: Tue, 5 Oct 2021 05:30:32 -0700 Subject: [PATCH 2/6] updated vscode.yml and genAiKey.js in scripts --- .github/workflows/vscode.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index d70d31b..7b0e97a 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -77,4 +77,5 @@ jobs: node scripts/genAiKey.js echo "y" | vsce package - name: npm test - run: npm test --silent \ No newline at end of file + run: npm test --silent + \ No newline at end of file From 26c9d245726d732493915bfdee67a1b7b23c85b9 Mon Sep 17 00:00:00 2001 From: Vikas <84580678+vikas0212git@users.noreply.github.com> Date: Tue, 5 Oct 2021 06:44:29 -0700 Subject: [PATCH 3/6] updated the yaml file --- .github/workflows/vscode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index 7b0e97a..561b0fb 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -24,7 +24,7 @@ jobs: id: check-tag run: | echo ::set-output name=ISPRODTAG::v?[0-9]+\.[0-9]+\.[0-9]+$ - if [[ ${{ github.event.ref }} =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ ${{ github.ref }} =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo ::set-output name=GITHUB_TAG::true fi - name: npm install From c36618fc4b45a62c06e908c67c51210af40f50c7 Mon Sep 17 00:00:00 2001 From: Vikas <84580678+vikas0212git@users.noreply.github.com> Date: Tue, 5 Oct 2021 10:27:20 -0700 Subject: [PATCH 4/6] updated the vscode yaml file --- .github/workflows/vscode.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index 561b0fb..693d1d2 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -1,14 +1,14 @@ name: CI -on: - push: - branches: - - master - tags: - - v*.*.* - pull_request: - branches: - - master +on: [push] + #push: + #branches: + #- master + #tags: + #- v*.*.* + #pull_request: + #branches: + #- master jobs: vscode_azure_iot_edge_Stage_Linux: @@ -27,6 +27,7 @@ jobs: if [[ ${{ github.ref }} =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo ::set-output name=GITHUB_TAG::true fi + - name: npm install run: | npm install @@ -78,4 +79,3 @@ jobs: echo "y" | vsce package - name: npm test run: npm test --silent - \ No newline at end of file From 2f128c9c44362d1f0d95bcb74ea632f042364b0d Mon Sep 17 00:00:00 2001 From: Vikas <84580678+vikas0212git@users.noreply.github.com> Date: Tue, 5 Oct 2021 10:38:03 -0700 Subject: [PATCH 5/6] Updated the vscode.yml --- .github/workflows/vscode.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index 693d1d2..4ecd458 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -1,14 +1,14 @@ name: CI -on: [push] - #push: - #branches: - #- master - #tags: - #- v*.*.* - #pull_request: - #branches: - #- master +on: + push: + branches: + - master + tags: + - v*.*.* + pull_request: + branches: + - master jobs: vscode_azure_iot_edge_Stage_Linux: From 7ad5086849f6d9a2396c5085f74677bf108bc928 Mon Sep 17 00:00:00 2001 From: Vikas <84580678+vikas0212git@users.noreply.github.com> Date: Tue, 5 Oct 2021 11:17:44 -0700 Subject: [PATCH 6/6] Update vscode.yml --- .github/workflows/vscode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index 4ecd458..891c572 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-node@v1 with: node-version: 16.x - - name: Check if release require + - name: Check if release required id: check-tag run: | echo ::set-output name=ISPRODTAG::v?[0-9]+\.[0-9]+\.[0-9]+$