-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (78 loc) · 2.41 KB
/
release.yml
File metadata and controls
92 lines (78 loc) · 2.41 KB
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
name: Release and Upload Artifact
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true
jobs:
release-and-upload:
runs-on: windows-latest
permissions:
contents: write
discussions: write
steps:
# Checkout repository
- name: Checkout Repository
uses: actions/checkout@v3
# Set up Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
# Install dependencies
- name: Install Dependencies
run: yarn install
# Build the extension
- name: Build Extension
run: yarn run build
# Package the extension as a .vsix file
- name: Package Extension
run: yarn run package:vsix
# Verify the .vsix file exists
- name: Verify .vsix File
run: |
if (!(Test-Path *.vsix)) {
Write-Error "Error: No .vsix file was found!"
exit 1
}
# Upload the .vsix file as an artifact
- name: Upload VSIX Artifact
uses: actions/upload-artifact@v4
with:
name: ProCommit.vsix
path: '*.vsix'
# Publish to Open VSX Registry
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
id: publishToOpenVSX
continue-on-error: true
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
# Publish to Visual Studio Marketplace
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
continue-on-error: true
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
# Generate release notes using Release Changelog Builder
- name: Generate Release Notes
id: generate_release_notes
uses: mikepenz/release-changelog-builder-action@v3
with:
configuration: .github/release-changelog-builder-config.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: '*.vsix'
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}