forked from Marus/cortex-debug
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (106 loc) · 3.46 KB
/
release.yml
File metadata and controls
125 lines (106 loc) · 3.46 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Create Release
on:
workflow_dispatch:
env:
VSIX_NAME: 'embedd-cortex-debug'
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
is_prerelease: ${{ steps.check_prerelease.outputs.is_prerelease }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Get version from package.json
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check prerelease status
id: check_prerelease
run: |
if [[ "${{ steps.get_version.outputs.version }}" == *"-rc"* ]]; then
echo "is_prerelease=true" >> $GITHUB_OUTPUT
else
echo "is_prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
run: npm install
- name: Build extension
run: npx vsce package
- name: Upload VSIX artifact
uses: actions/upload-artifact@v7
with:
name: vsix-package
path: ./*.vsix
retention-days: 7
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download VSIX artifact
uses: actions/download-artifact@v8
with:
name: vsix-package
path: artifacts
- name: Read changelog
id: changelog_release
uses: embedd-actions/read_changelog_action@v4
with:
changelogfile: 'CHANGELOG.md'
tag: ${{ needs.build.outputs.version }}
- name: Prepare release notes
env:
REL_CHANGES: ${{ steps.changelog_release.outputs.content }}
run: |
echo "## [${{ needs.build.outputs.version }}] - $(date +'%Y-%m-%d')" >> Release_Notes.md
echo "" >> Release_Notes.md
echo "$REL_CHANGES" >> Release_Notes.md
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
bodyFile: "Release_Notes.md"
allowUpdates: false
prerelease: ${{ needs.build.outputs.is_prerelease }}
tag: "v${{ needs.build.outputs.version }}"
commit: ${{ github.ref_name }}
artifacts: "artifacts/*.vsix"
artifactContentType: application/octet-stream
publish-open-vsx:
name: Open VSX Registry
needs: build
runs-on: ubuntu-latest
if: needs.build.outputs.is_prerelease == 'false'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download VSIX artifact
uses: actions/download-artifact@v8
with:
name: vsix-package
path: artifacts
- name: Publish to Open VSX
run: npx ovsx publish artifacts/*.vsix -p ${{ secrets.OPEN_VSX_TOKEN }}
publish-vscode-marketplace:
name: VS Code Marketplace
needs: build
runs-on: ubuntu-latest
# if: needs.build.outputs.is_prerelease == 'false'
if: false # Temporarily disable publishing to VS Code Marketplace
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download VSIX artifact
uses: actions/download-artifact@v8
with:
name: vsix-package
path: artifacts
- name: Publish to VS Code Marketplace
run: npx @vscode/vsce publish --packagePath artifacts/*.vsix
env:
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}