25
25
strategy :
26
26
matrix :
27
27
os : [ubuntu-latest, windows-latest, macOS-latest]
28
+ outputs :
29
+ name : ${{ steps.set-version.outputs.name }}
30
+ version : ${{ steps.set-version.outputs.version }}
28
31
steps :
29
32
- uses : actions/checkout@v2
30
33
- run : git fetch --depth=1 origin +refs/tags/*:refs/tags/*
@@ -65,49 +68,31 @@ jobs:
65
68
run : |
66
69
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
67
70
- uses : actions/upload-artifact@v2
68
- if : runner.os == 'Windows'
71
+ if : ( runner.os == 'Windows') && (github.event_name != 'release')
69
72
with :
70
73
name : ${{ steps.set-version.outputs.name }}.vsix
71
74
path : ${{ steps.set-version.outputs.name }}.vsix
72
- - uses : actions/upload-artifact@v2
73
- if : runner.os == 'Windows'
74
- with :
75
- name : meta
76
- path : |
77
- .name
78
- .version
79
75
beta :
80
76
if : (github.event_name == 'push')
81
77
runs-on : windows-latest
82
78
needs : build
83
79
steps :
84
80
- uses : actions/download-artifact@v2
85
81
with :
86
- name : meta
87
- path : .
88
- - name : Set an output
89
- id : set-version
90
- if : runner.os == 'Windows'
91
- run : |
92
- set -x
93
- echo ::set-output name=version::`cat .version`
94
- echo ::set-output name=name::`cat .name`
95
- - uses : actions/download-artifact@v2
96
- with :
97
- name : ${{ steps.set-version.outputs.name }}.vsix
82
+ name : ${{ needs.build.outputs.name }}.vsix
98
83
- name : Create Pre-Release
99
84
id : create_release
100
85
uses : actions/create-release@v1
101
86
if : runner.os == 'Windows'
102
87
env :
103
88
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104
89
with :
105
- tag_name : v${{ steps.set-version .outputs.version }}
106
- release_name : v${{ steps.set-version .outputs.version }}
90
+ tag_name : v${{ needs.build .outputs.version }}
91
+ release_name : v${{ needs.build .outputs.version }}
107
92
prerelease : ${{ github.event_name != 'release' }}
108
93
body : |
109
94
Changes in this pre-release
110
- ${{ steps.set-version .outputs.changelog }}
95
+ ${{ needs.build .outputs.changelog }}
111
96
- name : Upload Pre-Release Asset
112
97
id : upload-release-asset
113
98
uses : actions/upload-release-asset@v1
@@ -116,8 +101,8 @@ jobs:
116
101
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
117
102
with :
118
103
upload_url : ${{ steps.create_release.outputs.upload_url }}
119
- asset_path : ${{ steps.set-version .outputs.name }}.vsix
120
- asset_name : ${{ steps.set-version .outputs.name }}.vsix
104
+ asset_path : ${{ needs.build .outputs.name }}.vsix
105
+ asset_name : ${{ needs.build .outputs.name }}.vsix
121
106
asset_content_type : application/zip
122
107
publish :
123
108
if : github.event_name == 'release'
@@ -128,10 +113,6 @@ jobs:
128
113
with :
129
114
ref : prerelease
130
115
token : ${{ secrets.TOKEN }}
131
- - uses : actions/download-artifact@v2
132
- with :
133
- name : meta
134
- path : .
135
116
- name : Use Node.js
136
117
uses : actions/setup-node@v1
137
118
with :
@@ -140,9 +121,8 @@ jobs:
140
121
id : set-version
141
122
shell : bash
142
123
run : |
143
- VERSION=`cat .version`
144
- NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
145
- echo ::set-output name=name::`cat .name`
124
+ VERSION=${{ needs.build.outputs.version }}
125
+ NEXT_VERSION=`echo $VERSION | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
146
126
tmp=$(mktemp)
147
127
git config --global user.name 'ProjectBot'
148
128
git config --global user.email '[email protected] '
@@ -155,7 +135,7 @@ jobs:
155
135
git push
156
136
- name : Build pre-release package
157
137
run : |
158
- npx vsce package --pre-release -o ${{ steps.set-version .outputs.name }}.vsix
138
+ npx vsce package --pre-release -o ${{ needs.build .outputs.name }}.vsix
159
139
- name : Upload Release Asset
160
140
id : upload-release-asset
161
141
uses : actions/upload-release-asset@v1
@@ -164,11 +144,11 @@ jobs:
164
144
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
165
145
with :
166
146
upload_url : ${{ github.event.release.upload_url }}
167
- asset_path : ${{ steps.set-version .outputs.name }}.vsix
168
- asset_name : ${{ steps.set-version .outputs.name }}.vsix
147
+ asset_path : ${{ needs.build .outputs.name }}.vsix
148
+ asset_name : ${{ needs.build .outputs.name }}.vsix
169
149
asset_content_type : application/zip
170
150
- name : Publish to VSCode Marketplace
171
151
shell : bash
172
152
run : |
173
153
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \
174
- npx vsce publish --pre-release --packagePath ${{ steps.set-version .outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true
154
+ npx vsce publish --pre-release --packagePath ${{ needs.build .outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true
0 commit comments