updated vscode.yml and genAiKey.js in scripts
This commit is contained in:
Родитель
06a0af238e
Коммит
6747f6cce6
|
@ -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
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче