File tree 1 file changed +28
-5
lines changed
1 file changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -19,19 +19,42 @@ jobs:
19
19
- name : Use Node.js
20
20
uses : actions/setup-node@master
21
21
with :
22
- version : 10
22
+ node- version : 10
23
23
- run : npm install
24
24
- run : npm run compile
25
25
- run : npm run test
26
26
env :
27
27
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")
28
34
- name : Build package
29
35
if : runner.os == 'Linux'
30
36
run : |
31
37
mkdir dist
32
- ./node_modules/.bin/vsce package -o ./dist/$(jq -r '.name + "-" + .version' package.json).vsix
33
- - uses : actions/upload-artifact@master
38
+ ./node_modules/.bin/vsce package -o ./dist/${{ steps.get-version.outputs.name }}.vsix
39
+ - name : Create Release
40
+ id : create_release
41
+ uses : actions/create-release@v1
42
+ if : runner.os == 'Linux'
43
+ env :
44
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45
+ with :
46
+ tag_name : v${{ steps.get-version.outputs.version }}
47
+ release_name : v${{ steps.get-version.outputs.version }}
48
+ draft : false
49
+ prerelease : true
50
+ - name : Upload Release Asset
51
+ id : upload-release-asset
52
+
34
53
if : runner.os == 'Linux'
54
+ env :
55
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35
56
with :
36
- name : vscode-objectscript
37
- path : dist
57
+ 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
You can’t perform that action at this time.
0 commit comments