26
26
outputs :
27
27
taggedbranch : ${{ steps.find-branch.outputs.taggedbranch }}
28
28
steps :
29
- - uses : actions/checkout@v2
29
+ - uses : actions/checkout@v3
30
30
- run : git fetch --depth=1 origin +refs/tags/*:refs/tags/*
31
31
- name : Find which branch the release tag points at
32
32
id : find-branch
36
36
git fetch --depth=1 origin +refs/heads/*:refs/heads/*
37
37
set -x
38
38
TAGGEDBRANCH=$(git for-each-ref --points-at=${{github.sha}} --format='%(refname:lstrip=2)' refs/heads/)
39
- echo ::set-output name= taggedbranch:: $TAGGEDBRANCH
39
+ echo " taggedbranch= $TAGGEDBRANCH" >> $GITHUB_OUTPUT
40
40
- name : Set an output
41
41
id : set-version
42
42
if : runner.os == 'Linux'
@@ -46,41 +46,41 @@ jobs:
46
46
[ $GITHUB_EVENT_NAME == 'release' ] && VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/}
47
47
CHANGELOG=$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d')
48
48
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
49
- echo ::set-output name= changelog:: $CHANGELOG
49
+ echo " changelog= $CHANGELOG" >> $GITHUB_OUTPUT
50
50
git tag -l | cat
51
51
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1))
52
52
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }}
53
- echo ::set-output name= version:: $VERSION
53
+ echo " version= $VERSION" >> $GITHUB_OUTPUT
54
54
NAME=$(jq -r '.name' package.json)-$VERSION
55
- echo ::set-output name=name:: $NAME
55
+ echo " name=$NAME" >> $GITHUB_OUTPUT
56
56
tmp=$(mktemp)
57
57
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
58
58
mkdir dist
59
59
echo $VERSION > .version
60
60
echo $NAME > .name
61
61
- name : Use Node.js
62
- uses : actions/setup-node@v1
62
+ uses : actions/setup-node@v3
63
63
with :
64
- node-version : 14.x
64
+ node-version : 16
65
65
- run : npm install
66
66
- name : lint
67
67
if : runner.os == 'Linux'
68
68
run : npm run lint
69
69
- run : npm run compile
70
70
- name : npm test
71
- uses : GabrielBB/xvfb-action @v1.0
71
+ uses : coactions/setup-xvfb @v1
72
72
with :
73
73
run : npm run test
74
74
- name : Build pre-release package
75
75
if : runner.os == 'Linux'
76
76
run : |
77
77
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
78
- - uses : actions/upload-artifact@v2
78
+ - uses : actions/upload-artifact@v3
79
79
if : (runner.os == 'Linux') && (github.event_name != 'release')
80
80
with :
81
81
name : ${{ steps.set-version.outputs.name }}.vsix
82
82
path : ${{ steps.set-version.outputs.name }}.vsix
83
- - uses : actions/upload-artifact@v2
83
+ - uses : actions/upload-artifact@v3
84
84
if : runner.os == 'Linux'
85
85
with :
86
86
name : meta
92
92
runs-on : ubuntu-latest
93
93
needs : build
94
94
steps :
95
- - uses : actions/download-artifact@v2
95
+ - uses : actions/download-artifact@v3
96
96
with :
97
97
name : meta
98
98
path : .
@@ -101,58 +101,43 @@ jobs:
101
101
if : runner.os == 'Linux'
102
102
run : |
103
103
set -x
104
- echo ::set-output name= version:: `cat .version`
105
- echo ::set-output name=name:: `cat .name`
106
- - uses : actions/download-artifact@v2
104
+ echo " version= `cat .version`" >> $GITHUB_OUTPUT
105
+ echo " name=`cat .name`" >> $GITHUB_OUTPUT
106
+ - uses : actions/download-artifact@v3
107
107
with :
108
108
name : ${{ steps.set-version.outputs.name }}.vsix
109
109
- name : Create Pre-Release
110
- id : create_release
111
- uses : actions/create- release@v1
110
+ id : create-release
111
+ uses : softprops/action-gh- release@v0
112
112
if : runner.os == 'Linux'
113
- env :
114
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
115
113
with :
116
114
tag_name : v${{ steps.set-version.outputs.version }}
117
- release_name : v${{ steps.set-version.outputs.version }}
118
115
prerelease : ${{ github.event_name != 'release' }}
119
- body : |
120
- Changes in this pre-release
121
- ${{ steps.set-version.outputs.changelog }}
122
- - name : Upload Pre-Release Asset
123
- id : upload-release-asset
124
- uses : actions/upload-release-asset@v1
125
- if : runner.os == 'Linux'
126
- env :
127
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128
- with :
129
- upload_url : ${{ steps.create_release.outputs.upload_url }}
130
- asset_path : ${{ steps.set-version.outputs.name }}.vsix
131
- asset_name : ${{ steps.set-version.outputs.name }}.vsix
132
- asset_content_type : application/zip
116
+ files : ${{ steps.set-version.outputs.name }}.vsix
117
+ token : ${{ secrets.GITHUB_TOKEN }}
133
118
publish :
134
119
needs : build
135
120
if : github.event_name == 'release' && needs.build.outputs.taggedbranch == 'prerelease'
136
121
runs-on : ubuntu-latest
137
122
steps :
138
- - uses : actions/checkout@v2
123
+ - uses : actions/checkout@v3
139
124
with :
140
125
ref : prerelease
141
126
token : ${{ secrets.TOKEN }}
142
- - uses : actions/download-artifact@v2
127
+ - uses : actions/download-artifact@v3
143
128
with :
144
129
name : meta
145
130
path : .
146
131
- name : Use Node.js
147
- uses : actions/setup-node@v1
132
+ uses : actions/setup-node@v3
148
133
with :
149
- node-version : 14.x
134
+ node-version : 16
150
135
- name : Prepare pre-release build
151
136
id : set-version
152
137
run : |
153
138
VERSION=`cat .version`
154
139
NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
155
- echo ::set-output name=name:: `cat .name`
140
+ echo " name=`cat .name`" >> $GITHUB_OUTPUT
156
141
tmp=$(mktemp)
157
142
git config --global user.name 'ProjectBot'
158
143
git config --global user.email '[email protected] '
@@ -168,15 +153,12 @@ jobs:
168
153
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
169
154
- name : Upload Release Asset
170
155
id : upload-release-asset
171
- uses : actions/upload-release-asset@v1
156
+ uses : softprops/action-gh-release@v0
172
157
if : runner.os == 'Linux'
173
- env :
174
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
175
158
with :
176
- upload_url : ${{ github.event.release.upload_url }}
177
- asset_path : ${{ steps.set-version.outputs.name }}.vsix
178
- asset_name : ${{ steps.set-version.outputs.name }}.vsix
179
- asset_content_type : application/zip
159
+ tag_name : ${{ github.event.release.tag_name }}
160
+ files : ${{ steps.set-version.outputs.name }}.vsix
161
+ token : ${{ secrets.GITHUB_TOKEN }}
180
162
- name : Publish to VSCode Marketplace
181
163
run : |
182
164
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \
0 commit comments