forked from OfficeDev/teams-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (64 loc) · 2.22 KB
/
vscode-marketplace.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
name: publish to VSCode marketplace
run-name: Publish-${{ inputs.run_id }}-${{ github.ref_name }}-isPreview-${{ inputs.isPreview }}-${{ inputs.series }}
on:
workflow_dispatch:
inputs:
run_id:
description: "Input the CD pipeline run ID to fetch the artifact"
required: true
default: ""
isPreview:
description: "Publish VSIX as a preview version(yes or no)"
required: true
default: "no"
series:
description: "release sprint series name"
required: false
default: ""
jobs:
publish-to-vscode-marketplace:
runs-on: ubuntu-latest
environment: production
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 14
- uses: actions/checkout@v2
with:
token: ${{ secrets.CD_PAT }}
ref: ${{ github.head_ref }}
- name: Install VSCE command
run: |
npm install vsce -g
- name: Download release artifacts
uses: Legit-Labs/action-download-artifact@v2
with:
run_id: ${{ github.event.inputs.run_id }}
name: release
github_token: ${{ secrets.CD_PAT }}
workflow: cd.yml
path: .
- name: get VSC beta tag
if: ${{ github.event.inputs.isPreview != 'no' }}
id: vsc_ver
run: |
VSC_VER=$(jq -c -r '.[]|select(.name == "ms-teams-vscode-extension")|.name+"@"+.version' versions.json)
echo "-------------------" $VSC_VER
echo "::set-output name=vsc_ver::$VSC_VER"
- uses: mathieudutour/github-tag-action@v6.0
if: ${{ github.event.inputs.isPreview != 'no' }}
with:
github_token: ${{ secrets.CD_PAT }}
custom_tag: ${{ steps.vsc_ver.outputs.vsc_ver }}
tag_prefix: ""
- name: release preview
if: ${{ github.event.inputs.isPreview != 'no' }}
env:
PAT: ${{ secrets.VSCE_PAT }}
run: vsce publish --pre-release --pat $PAT --packagePath *.vsix
- name: release to VSCode marketplace
if: ${{ github.event.inputs.isPreview == 'no' }}
run: vsce publish --pat $PAT --packagePath *.vsix
env:
PAT: ${{ secrets.VSCE_PAT }}