forked from hashicorp/packer-plugin-virtualbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
24 lines (23 loc) · 1.2 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
import subprocess
os.system("rm -rf packer-plugin-virtualbox*")
version = 'v2.0.6'
x = []
os.system(f'go build -o packer-plugin-virtualbox_{version}_x5.0_darwin_arm64 .')
os.system(
f'zip packer-plugin-virtualbox_{version}_x5.0_darwin_arm64.zip packer-plugin-virtualbox_{version}_x5.0_darwin_arm64')
h1 = subprocess.getoutput(f'shasum -a 256 packer-plugin-virtualbox_{version}_x5.0_darwin_arm64.zip').split(' ')[0]
os.system(f'go build -o packer-plugin-virtualbox_{version}_x7.0_darwin_arm64 .')
# os.system(
# f'zip packer-plugin-virtualbox_{version}_x7.0_darwin_arm64.zip packer-plugin-virtualbox_{version}_x7.0_darwin_arm64')
# h2 = subprocess.getoutput(f'shasum -a 256 packer-plugin-virtualbox_{version}_x7.0_darwin_arm64.zip').split(' ')[0]
x.append([h1, f'packer-plugin-virtualbox_{version}_x5.0_darwin_arm64.zip'])
# x.append([h2, f'packer-plugin-virtualbox_{version}_x7.0_darwin_arm64.zip'])
with open(f'packer-plugin-virtualbox_{version}_SHA256SUMS', 'w', encoding='utf8') as f:
for item in x:
f.write(f'{item[0]} {item[1]}\n')
os.system('git add .')
os.system('git commit -s -m "over"')
os.system('git push liushuo')
os.system(f'git tag {version}')
os.system('git push liushuo --tags')