-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 2.42 KB
/
release.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
name: Build & Publish Extension
on:
push:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
name: Build and package
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: |
npm install -g @vscode/vsce
npm ci
- name: Get NPM Version
id: package-version
uses: martinbeentjes/[email protected]
- name: Build extension
run: vsce package -o postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
path: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
if-no-files-found: error
- name: Create release with artifact
if: ${{ success() && steps.package-version.outputs.current-version }}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
name: Release v${{ steps.package-version.outputs.current-version }}
tag_name: v${{ steps.package-version.outputs.current-version }}
draft: false
files: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: postscript-preview-${{ steps.package-version.outputs.current-version }}.vsix