@@ -22,8 +22,8 @@ concurrency:
22
22
23
23
jobs :
24
24
build :
25
- timeout-minutes : 10
26
25
runs-on : ubuntu-latest
26
+ timeout-minutes : 10
27
27
strategy :
28
28
matrix :
29
29
include :
@@ -127,51 +127,63 @@ jobs:
127
127
prerelease : ${{ github.event_name != 'release' }}
128
128
files : ' **/*.vsix'
129
129
token : ${{ secrets.GITHUB_TOKEN }}
130
+
130
131
publish :
132
+ runs-on : ubuntu-latest
131
133
needs : build
132
- if : github.event_name == 'release' && needs.build.outputs.taggedbranch == 'master'
134
+ if : success() && github.event_name == 'release'
135
+ steps :
136
+ - name : Use Node.js
137
+ uses : actions/setup-node@v4
138
+ with :
139
+ node-version : 18
140
+ - run : npm install -g @vscode/vsce
141
+ - name : Download packages
142
+ uses : actions/download-artifact@v4
143
+ - name : Attach packages to release
144
+ uses : softprops/action-gh-release@v2
145
+ with :
146
+ tag_name : ${{ github.event.release.tag_name }}
147
+ files : ' **/*.vsix'
148
+ body : See CHANGELOG for details
149
+ token : ${{ secrets.GITHUB_TOKEN }}
150
+ - name : Publish to VS Code Marketplace
151
+ env :
152
+ VSCE_PAT : ${{ secrets.VSCE_TOKEN }}
153
+ if : env.VSCE_PAT != null
154
+ run : vsce publish --packagePath $(find . -iname "*.vsix" -type f)
155
+ - name : Publish to Open VSX Registry
156
+ env :
157
+ OVSX_PAT : ${{ secrets.OVSX_TOKEN }}
158
+ if : env.OVSX_PAT != null
159
+ timeout-minutes : 5
160
+ run : find . -iname "*.vsix" -type f -exec npx ovsx publish {} \;
161
+ bump_version :
133
162
runs-on : ubuntu-latest
163
+ needs : [build, publish]
164
+ if : github.event_name == 'release'
134
165
steps :
135
- - uses : actions/checkout@v4
166
+ - name : Check out repository
167
+ uses : actions/checkout@v4
136
168
with :
137
169
ref : master
138
- token : ${{ secrets.TOKEN }}
139
- - uses : actions/download-artifact@v4
170
+ - name : Download metadata
171
+ uses : actions/download-artifact@v4
140
172
with :
141
173
name : meta
142
174
path : .
143
175
- name : Use Node.js
144
176
uses : actions/setup-node@v4
145
177
with :
146
178
node-version : 18
147
- - name : Prepare build
148
- id : set-version
179
+ - name : Create commit
149
180
run : |
150
181
VERSION=`cat meta.version`
151
182
NEXT_VERSION=`cat meta.version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
152
- echo "name=`cat meta.name`" >> $GITHUB_OUTPUT
153
183
tmp=$(mktemp)
154
184
git config --global user.name 'ProjectBot'
155
185
git config --global user.email '[email protected] '
156
186
jq --arg version "${NEXT_VERSION}-SNAPSHOT" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
157
187
git add package.json
158
- git commit -m 'auto bump version with release'
159
- jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
160
- npm install
161
- jq 'del(.enableProposedApi,.enabledApiProposals)' package.json > "$tmp" && mv "$tmp" package.json
162
- git push
163
- - name : Build package
164
- run : |
165
- npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
166
- - name : Upload Release Asset
167
- id : upload-release-asset
168
- uses : softprops/action-gh-release@v1
169
- if : runner.os == 'LinuxTODO'
170
- with :
171
- tag_name : ${{ github.event.release.tag_name }}
172
- files : ${{ steps.set-version.outputs.name }}.vsix
173
- token : ${{ secrets.GITHUB_TOKEN }}
174
- - name : Publish to VSCode Marketplace
175
- run : |
176
- [ -n "${{ secrets.VSCE_TOKEN }}" ] && \
177
- npx vsce publish --packagePath ${{ steps.set-version.outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true
188
+ git commit -m 'auto bump version with release [skip ci]'
189
+ git push
0 commit comments