-
-
Notifications
You must be signed in to change notification settings - Fork 3
159 lines (157 loc) · 6.04 KB
/
ci.yaml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Build Binary
on:
push:
paths-ignore:
- '.github/**'
- '**/*.md'
- 'images/**'
branches:
- '*'
tags:
- '*'
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm install
- run: npm run compile
publish-dev:
needs: build
runs-on: ubuntu-latest
if: success() && startsWith(github.ref, 'refs/heads/main')
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm install
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v10.1.1
- name: update version
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "extension_version"
replace: ${{ steps.package-version.outputs.current-version}}
include: "vss-extension.json"
- name: update extension id
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "extension_id"
replace: ${{ secrets.EXTENSION_DEV_ID }}
include: "vss-extension.json"
- name: update extension publisher
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "extension_publisher"
replace: ${{ secrets.EXTENSION_DEV_PUBLISHER }}
include: "vss-extension.json"
- name: update extension public
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "extension_public"
replace: false
include: "vss-extension.json"
- name: update task id
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "task_id"
replace: ${{ secrets.TASK_DEV_ID }}
include: "goreleaserTask/task.json"
- run: npm run create
- name: Upload azure devops extension to marketplace
run: |
export VERSION=${{ steps.package-version.outputs.current-version}}
npm run unpublish_ci
npm run publish_ci
npm run share_dev
env:
AZURE_DEVOPS_EXT_PAT: ${{ secrets.AZURE_DEVOPS_EXT_PAT_DEV }}
PUBLISHER_NAME: ${{ secrets.EXTENSION_DEV_PUBLISHER }}
EXTENSION_ID: ${{ secrets.EXTENSION_DEV_ID }}
SHARE_WITH_DEV_ORGA: ${{ secrets.SHARE_WITH_DEV_ORGA }}
release:
needs: build
runs-on: ubuntu-latest
if: success() && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm install
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1
- name: update version
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "extension_version"
replace: ${{ steps.package-version.outputs.current-version}}
include: "vss-extension.json"
- name: update extension id
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "extension_id"
replace: ${{ secrets.EXTENSION_PROD_ID }}
include: "vss-extension.json"
- name: update extension publisher
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "extension_publisher"
replace: ${{ secrets.EXTENSION_PROD_PUBLISHER }}
include: "vss-extension.json"
- name: update extension public
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "extension_public"
replace: true
include: "vss-extension.json"
- name: update task id
uses: jacobtomlinson/gha-find-replace@863001a682308a0a2405e69e645cb0899b5ee64b # v3.0.4
with:
find: "task_id"
replace: ${{ secrets.TASK_PROD_ID }}
include: "goreleaserTask/task.json"
- run: npm run create
- name: Upload azure devops extension to marketplace
run: |
export VERSION=${{ steps.package-version.outputs.current-version}}
npm run publish_ci
env:
AZURE_DEVOPS_EXT_PAT: ${{ secrets.AZURE_DEVOPS_EXT_PAT }}
PUBLISHER_NAME: ${{ secrets.EXTENSION_PROD_PUBLISHER }}
EXTENSION_ID: ${{ secrets.EXTENSION_PROD_ID }}
- name: Upload azure devops extension to release
if: always()
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
overwrite: true
tag: ${{ github.ref }}
- run: git fetch origin main
if: always()
- name: 'Automated Version Bump of package.json'
if: always()
uses: phips28/gh-action-bump-version@fdad52b3b3bbe8fad96b8ca18c56127a96f603db # v11.0.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
skip-tag: 'true'
target-branch: 'main'