16
16
set -e
17
17
/usr/bin/Xvfb :10 -ac >> /tmp/Xvfb.out 2>&1 &
18
18
disown -ar
19
+ - name : Set an output
20
+ id : set-version
21
+ if : runner.os == 'Linux'
22
+ run : |
23
+ set -x
24
+ VERSION=$(jq -r '.version' package.json | cut -d- -f1)
25
+ echo ::set-output name=changelog::$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d')
26
+ VERSION+=-beta
27
+ git tag -l | cat
28
+ VERSION+=$(($(git tag -l "v$VERSION*" 2>/dev/null | tail -1 | cut -d. -f4)+1))
29
+ echo ::set-output name=version::$VERSION
30
+ echo ::set-output name=name::$(jq -r '.name' package.json)-$VERSION
31
+ tmp=$(mktemp)
32
+ jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
19
33
- name : Use Node.js
20
34
uses : actions/setup-node@master
21
35
with :
@@ -25,36 +39,33 @@ jobs:
25
39
- run : npm run test
26
40
env :
27
41
DISPLAY : :10
28
- - name : Set an output
29
- id : get-version
30
- if : runner.os == 'Linux'
31
- run : |
32
- echo ::set-output name=version::$(jq -r '.version' package.json | cut -d- -f1)-B$(date -u "+%Y%m%d")
33
- echo ::set-output name=name::$(jq -r '.name+"-"+.version' package.json | cut -d- -f1-3)-B$(date -u "+%Y%m%d")
34
42
- name : Build package
35
43
if : runner.os == 'Linux'
36
44
run : |
37
45
mkdir dist
38
- ./node_modules/.bin/vsce package -o ./dist/${{ steps.get -version.outputs.name }}.vsix
46
+ ./node_modules/.bin/vsce package -o ./dist/${{ steps.set -version.outputs.name }}.vsix
39
47
- name : Create Release
40
48
id : create_release
41
49
uses : actions/create-release@v1
42
50
if : runner.os == 'Linux'
43
51
env :
44
52
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45
53
with :
46
- tag_name : v${{ steps.get-version.outputs.version }}
47
- release_name : v${{ steps.get-version.outputs.version }}
54
+ tag_name : v${{ steps.set-version.outputs.version }}
55
+ release_name : v${{ steps.set-version.outputs.version }}
56
+ body : |
57
+ Changes in this release
58
+ ${{ steps.set-version.outputs.changelog}}
48
59
draft : false
49
60
prerelease : true
50
61
- name : Upload Release Asset
51
- id : upload-release-asset
62
+ id : upload-release-asset
52
63
53
64
if : runner.os == 'Linux'
54
65
env :
55
66
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56
67
with :
57
68
upload_url : ${{ steps.create_release.outputs.upload_url }}
58
- asset_path : ./dist/${{ steps.get -version.outputs.name }}.vsix
59
- asset_name : ${{ steps.get -version.outputs.name }}.vsix
60
- asset_content_type : application/zip
69
+ asset_path : ./dist/${{ steps.set -version.outputs.name }}.vsix
70
+ asset_name : ${{ steps.set -version.outputs.name }}.vsix
71
+ asset_content_type : application/zip
0 commit comments