-
Notifications
You must be signed in to change notification settings - Fork 9
96 lines (78 loc) · 2.7 KB
/
main.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build and Deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: 'git-version.yml'
- name: Npm install
run: npm install
- name: Tfx install
run: npm install -g tfx-cli
- name: Npm compile
run: |
export NODE_OPTIONS="--openssl-legacy-provider"
npm run compile
- name: Tfx Package Test
run: "tfx extension create --manifest-globs vss-extension.json --overrides-file configs/test.json --override '{\"version\": \"${{ steps.gitversion.outputs.semVer }}.${{ github.run_number }}\"}' --output-path out"
- name: Tfx Package Prod
if: github.ref == 'refs/heads/main'
run: "tfx extension create --manifest-globs vss-extension.json --overrides-file configs/release.json --override '{\"version\": \"${{ steps.gitversion.outputs.semVer }}\"}' --output-path out"
- name: Upload Tfx Package
uses: actions/[email protected]
with:
name: tfxpackage
path: ./out/
deployment_test:
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
environment: test
steps:
- name: Download Tfx Package
uses: actions/[email protected]
with:
name: tfxpackage
- name: Tfx install
run: npm install -g tfx-cli
- name: Tfx Package
env:
AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }}
run: |
filename=$(ls bluebasher.bluebasher-easy-branch-creator-test-*.vsix)
tfx extension publish --vsix $filename --auth-type pat --token $AZURE_DEVOPS_PAT
deployment_production:
if: github.ref == 'refs/heads/main'
needs: [deployment_test]
runs-on: ubuntu-latest
environment: production
steps:
- name: Download Tfx Package
uses: actions/[email protected]
with:
name: tfxpackage
- name: Tfx install
run: npm install -g tfx-cli
- name: Tfx Package
env:
AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }}
run: |
filename=$(ls bluebasher.bluebasher-easy-branch-creator-*.vsix)
tfx extension publish --vsix $filename --auth-type pat --token $AZURE_DEVOPS_PAT