-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (68 loc) · 2.53 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build and test
on:
push:
branches: [develop, main]
jobs:
build:
name: Build, test and pack tasks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v1
with:
node-version: 12
- name: install modclean
run: |
npm install modclean
env:
CI: true
- name: build tasks
run: |
cd pbicli
npm install
npm run test
echo Prepare 'node_modules' of $task
rm -Rf node_modules
npm install --production
$GITHUB_WORKSPACE/node_modules/.bin/modclean -r -n default:safe,default:caution
cd $GITHUB_WORKSPACE
- name: install tfx-cli
run: |
npm install tfx-cli
env:
CI: true
# Production package
- name: run tfx-cli - production version
if: ${{ endsWith(github.ref, 'main') }}
run: |
$GITHUB_WORKSPACE/node_modules/.bin/tfx extension create --manifest-globs $GITHUB_WORKSPACE/vss-extension.json
- name: extract version name - production version
if: ${{ endsWith(github.ref, 'main') }}
id: extract_version
run: |
node -e "const v = require('./vss-extension.json').version;console.log('::set-output name=version::' + v);"
- name: store extension - production version
if: ${{ endsWith(github.ref, 'main') }}
uses: actions/upload-artifact@v2
with:
name: pbicli.pbicli-${{ steps.extract_version.outputs.version }}
path: |
pbicli.pbicli-${{ steps.extract_version.outputs.version }}.vsix
# Preview package
- name: run tfx-cli - preview version
if: ${{ endsWith(github.ref, 'develop') }}
run: |
$GITHUB_WORKSPACE/node_modules/.bin/tfx extension create --manifest-globs $GITHUB_WORKSPACE/vss-extension-preview.json
- name: extract version name - preview version
if: ${{ endsWith(github.ref, 'develop') }}
id: extract_version_preview
run: |
node -e "const v = require('./vss-extension-preview.json').version;console.log('::set-output name=version::' + v);"
- name: store extension - preview version
if: ${{ endsWith(github.ref, 'develop') }}
uses: actions/upload-artifact@v2
with:
name: pbicli.pbicli-preview-${{ steps.extract_version_preview.outputs.version }}
path: |
pbicli.pbicli-preview-${{ steps.extract_version_preview.outputs.version }}.vsix