Skip to content

Commit 7a15508

Browse files
committed
暂时先这样吧
1 parent 39b3d46 commit 7a15508

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

publish.lua

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ if rootPath == '' then
44
rootPath = './'
55
end
66
loadfile(rootPath .. 'server/platform.lua')('script')
7+
require 'bee'
78
local fs = require 'bee.filesystem'
89
local subprocess = require 'bee.subprocess'
910
local platform = require 'bee.platform'
10-
11+
local thread = require 'bee.thread'
1112

1213
require 'utility'
13-
dofile(rootPath .. 'server/test.lua')
14+
--dofile(rootPath .. 'server/test.lua')
1415

1516
package.path = package.path
1617
.. ';' .. rootPath .. '/?.lua'
@@ -187,12 +188,41 @@ removeFiles(out) {
187188
},
188189
}
189190

190-
local path = ROOT / 'publish' / 'lua'
191-
print('清理发布目录...')
192-
removeFiles(path)(true)
191+
print('完成')
193192

194-
print('复制到发布目录...')
195-
local count = copyFiles(out, path)(true)
196-
print(('复制了[%d]个文件'):format(count))
193+
for i = 5, 0, -1 do
194+
print('将在' .. i .. '秒后发布版本:', version)
195+
thread.sleep(1)
196+
end
197197

198-
print('完成')
198+
local vsix = ROOT / 'publish' / ('lua-' .. version .. '.vsix')
199+
local p, err = subprocess.shell {
200+
'vsce', 'package',
201+
'-o', vsix,
202+
cwd = out,
203+
stderr = true,
204+
}
205+
if not p then
206+
error(err)
207+
end
208+
p:wait()
209+
print(p.stderr:read 'a')
210+
211+
subprocess.shell {
212+
'git', 'tag', 'v' .. tostring(version),
213+
}
214+
215+
subprocess.shell {
216+
'git', 'push', '--tags',
217+
}
218+
219+
local p, err = subprocess.shell {
220+
'vsce', 'publish',
221+
cwd = out,
222+
stderr = true,
223+
}
224+
if not p then
225+
error(err)
226+
end
227+
p:wait()
228+
print(p.stderr:read 'a')

0 commit comments

Comments
 (0)