Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
105 lines (92 sloc) 3.22 KB
def main():
return [
pipeline()
]
def minify_pack():
return {
'name': 'minify_pack',
'image': 'patwie/dms-release:latest',
'commands': [
'rm -rf static.min',
'mkdir static.min',
'mkdir static.min/fonts',
'mkdir static.min/css',
'mkdir static.min/js',
'minify -o static.min/css/min.css static/css/main.css static/css/all.min.css',
'minify -o static.min/index.html static/index.html',
# 'minify -o static.min/js/jquery-3.4.1.min.js static/js/jquery-3.4.1.min.js',
# 'minify -o static.min/js/pdf.min.js static/js/pdf.js',
# 'minify -o static.min/js/pdf-worker.min.js static/js/pdf-worker.js',
# 'minify -o static.min/js/fuzzysort.min.js static/js/fuzzysort.js',
# 'minify -o static.min/js/main.min.js static/js/main.js',
'minify -o static.min/js/jquery-3.4.1.min.js static/js/jquery-3.4.1.min.js',
'minify -o static.min/js/pdf.min.js static/js/pdf.js static/js/pdf.worker.js',
'minify -o static.min/js/main.min.js static/js/fuzzysort.js static/js/main.js',
'minify -o static.min/js/dropzone.min.js static/js/dropzone.js',
'cp static/fonts/* static.min/fonts/',
'cp static/favicon.ico static.min/favicon.ico',
'/go/bin/packr2',
]
}
def build_step(os, arch):
commands = [
'dir',
'go build'
]
if os == 'windows':
commands = commands + \
['mv digitalmusicstand.exe digitalmusicstand-' + os + '-' + arch + '.exe']
else:
commands = commands + \
['mv digitalmusicstand digitalmusicstand-' + os + '-' + arch]
return {
'name': 'build-' + os + '-' + arch,
'image': 'golang:1.13',
'commands': commands,
'environment': {
'GOOS': os,
'GOARCH': arch,
}
}
def create_release():
return {
'name': 'create_release',
'image': 'patwie/tar:latest',
'commands': [
'zip -rv digitalmusicstand-windows-amd64.zip README.md digitalmusicstand-windows-amd64.exe',
'tar -czvf digitalmusicstand-linux-amd64.tar.gz README.md digitalmusicstand-linux-amd64',
'tar -czvf digitalmusicstand-linux-arm.tar.gz README.md digitalmusicstand-linux-arm',
'tar -czvf digitalmusicstand-linux-arm64.tar.gz README.md digitalmusicstand-linux-arm64'
],
}
def upload_release():
return {
'name': 'upload_release',
'image': 'plugins/github-release',
'settings': {
'api_key': {'from_secret': 'github_token'},
'files': [
'digitalmusicstand-windows-amd64.zip',
'digitalmusicstand-linux-amd64.tar.gz',
'digitalmusicstand-linux-arm64.tar.gz',
'digitalmusicstand-linux-arm.tar.gz',
],
'checksum': ['md5', 'sha256'],
},
'when': {'event': 'tag'}
}
def pipeline():
return {
'kind': 'pipeline',
'type': 'docker',
'name': 'linux',
'steps': [
minify_pack(),
build_step('linux', 'amd64'),
build_step('linux', 'arm64'),
build_step('linux', 'arm'),
build_step('windows', 'amd64'),
create_release(),
upload_release()
]
}
You can’t perform that action at this time.