-
Notifications
You must be signed in to change notification settings - Fork 54
94 lines (79 loc) · 2.73 KB
/
publish-v2.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
name: Build & Publish V2
on: [workflow_dispatch]
permissions:
contents: read
jobs:
JobBuild:
name: release
runs-on: [self-hosted, "1ES.Pool=1es-vscode-aks-tools-pool"]
# Expose step outputs as job outputs
outputs:
currentversion: ${{ steps.package_version.outputs.current-version }}
changelog_reader_changes: ${{ steps.changelog_reader.outputs.changes }}
permissions:
actions: read
contents: read
deployments: read
packages: none
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-sudo: true
disable-telemetry: true
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Use Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
# Run install dependencies
- name: Install dependencies
run: npm run install:all
# Ensure project builds successfully before creating release
- name: Build
run: npm run webpack
- name: Get current package version
id: package_version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1
JobsPublish:
name: publish
runs-on: [self-hosted, "1ES.Pool=1es-vscode-aks-tools-pool"]
needs: JobBuild
permissions:
actions: read
contents: write
deployments: read
packages: none
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-sudo: true
disable-telemetry: true
# Checkout the code again for release
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Use Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
# Run install dependencies
- name: Install dependencies
run: npm run install:all
#Build and package
- name: Build
run: npm run webpack
- name: federated login
uses: azure/login@v2
with:
auth-type: IDENTITY
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Publish packaged extension
run: |
npx vsce publish --azure-credential --packagePath *.vsix