@@ -23,12 +23,16 @@ jobs:
2323 strategy :
2424 matrix :
2525 os : [ubuntu-latest, windows-latest, macOS-latest]
26+ outputs :
27+ name : ${{ steps.set-version.outputs.name }}
28+ version : ${{ steps.set-version.outputs.version }}
2629 steps :
2730 - uses : actions/checkout@v2
2831 - run : git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2932 - name : Set an output
3033 id : set-version
31- if : runner.os == 'Linux'
34+ if : runner.os == 'Windows'
35+ shell : bash
3236 run : |
3337 set -x
3438 VERSION=$(jq -r '.version' package.json | cut -d- -f1)
@@ -58,83 +62,59 @@ jobs:
5862 with :
5963 run : npm run test
6064 - name : Build package
61- if : runner.os == 'Linux'
6265 run : |
6366 npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
6467 - uses : actions/upload-artifact@v2
65- if : runner.os == 'Linux'
68+ if : ( runner.os == 'Windows') && (github.event_name != 'release')
6669 with :
6770 name : ${{ steps.set-version.outputs.name }}.vsix
6871 path : ${{ steps.set-version.outputs.name }}.vsix
69- - uses : actions/upload-artifact@v2
70- if : runner.os == 'Linux'
71- with :
72- name : meta
73- path : |
74- .name
75- .version
7672 beta :
7773 if : (github.event_name == 'push')
78- runs-on : ubuntu -latest
74+ runs-on : windows -latest
7975 needs : build
8076 steps :
8177 - uses : actions/download-artifact@v2
8278 with :
83- name : meta
84- path : .
85- - name : Set an output
86- id : set-version
87- if : runner.os == 'Linux'
88- run : |
89- set -x
90- echo ::set-output name=version::`cat .version`
91- echo ::set-output name=name::`cat .name`
92- - uses : actions/download-artifact@v2
93- with :
94- name : ${{ steps.set-version.outputs.name }}.vsix
79+ name : ${{ needs.test.outputs.name }}.vsix
9580 - name : Create Release
9681 id : create_release
9782 uses : actions/create-release@v1
98- if : runner.os == 'Linux'
9983 env :
10084 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
10185 with :
102- tag_name : v${{ steps.set-version .outputs.version }}
103- release_name : v${{ steps.set-version .outputs.version }}
86+ tag_name : v${{ needs.test .outputs.version }}
87+ release_name : v${{ needs.test .outputs.version }}
10488 prerelease : ${{ github.event_name != 'release' }}
10589 body : |
10690 Changes in this release
107- ${{ steps.set-version .outputs.changelog }}
91+ ${{ needs.test .outputs.changelog }}
10892 - name : Upload Release Asset
10993 id : upload-release-asset
11094 uses : actions/upload-release-asset@v1
111- if : runner.os == 'Linux'
11295 env :
11396 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
11497 with :
11598 upload_url : ${{ steps.create_release.outputs.upload_url }}
116- asset_path : ${{ steps.set-version .outputs.name }}.vsix
117- asset_name : ${{ steps.set-version .outputs.name }}.vsix
99+ asset_path : ${{ needs.test .outputs.name }}.vsix
100+ asset_name : ${{ needs.test .outputs.name }}.vsix
118101 asset_content_type : application/zip
119102 publish :
120103 if : github.event_name == 'release'
121- runs-on : ubuntu -latest
104+ runs-on : windows -latest
122105 needs : build
123106 steps :
124107 - uses : actions/checkout@v2
125108 with :
126109 ref : master
127110 token : ${{ secrets.TOKEN }}
128- - uses : actions/download-artifact@v2
129- with :
130- name : meta
131- path : .
132111 - name : Use Node.js
133112 uses : actions/setup-node@v1
134113 with :
135114 node-version : 12.x
136115 - name : Prepare build
137116 id : set-version
117+ shell : bash
138118 run : |
139119 VERSION=`cat .version`
140120 NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
@@ -155,7 +135,6 @@ jobs:
155135 - name : Upload Release Asset
156136 id : upload-release-asset
157137 uses : actions/upload-release-asset@v1
158- if : runner.os == 'Linux'
159138 env :
160139 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
161140 with :
0 commit comments