forked from Samsung/ONE-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 1.74 KB
/
publish-extension.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
name: Publish extension
on:
workflow_call:
inputs:
prerelease:
description: 'Identify the release as a prerelease (default: false)'
type: boolean
default: false
publish:
description: 'Publish extension to marketplace'
type: boolean
default: false
outputs:
package_name:
description: 'Package name'
value: ${{ jobs.publish-extension.outputs.package_name }}
secrets:
VSCE_PAT:
required: true
jobs:
publish-extension:
runs-on: ubuntu-latest
outputs:
package_name: ${{ steps.search_package.outputs.package_name }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install node packages
run: |
npm install
- name: Install vsce tool
run: |
npm install -g vsce
- name: Create vsix package (pre-release)
if: ${{ inputs.prerelease == 'true' }}
run: |
vsce package --pre-release
- name: Create vsix package
if: ${{ inputs.prerelease == 'false' }}
run: |
vsce package
- id: search_package
run: |
fname=$(find . -name "*.vsix" | xargs -I {} basename {})
echo "package_name=${fname}" >> $GITHUB_OUTPUT
- name: Publish vsix package
if: ${{ inputs.publish }}
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
vsce publish -i ${{ steps.search_package.outputs.package_name }}
- name: Upload vsix package
uses: actions/upload-artifact@v3
with:
name: ${{ steps.search_package.outputs.package_name }}
path: ./${{ steps.search_package.outputs.package_name }}