|
| 1 | +#!/bin/sh -l |
| 2 | + |
| 3 | +# timestamp to use in name of snapshot builds |
| 4 | +timestamp=$(date '+%Y%m%d%H%M%S') |
| 5 | + |
| 6 | +# setup git user |
| 7 | +git config --global user.email "automated.build@dasm.com" |
| 8 | +git config --global user.name "automated build" |
| 9 | + |
| 10 | +# clone dasm branch |
| 11 | +git clone --single-branch --branch $1 https://$2:$3@github.com/dasm-assembler/dasm.git |
| 12 | + |
| 13 | +# build dasm binaries for all platforms |
| 14 | +cd dasm/docker |
| 15 | +./make_dasm_all_platforms.sh |
| 16 | + |
| 17 | +# create empty snapshot-builds folder |
| 18 | +cd .. |
| 19 | +rm -r snapshot-builds |
| 20 | +mkdir snapshot-builds |
| 21 | + |
| 22 | +# create package folders for all platforms and tar gz 'm up |
| 23 | +mkdir -p bin/dasm-$timestamp-linux-x64 |
| 24 | +mkdir -p bin/dasm-$timestamp-linux-x86 |
| 25 | +mkdir -p bin/dasm-$timestamp-osx-x64 |
| 26 | +mkdir -p bin/dasm-$timestamp-osx-x86 |
| 27 | +mkdir -p bin/dasm-$timestamp-win-x64 |
| 28 | +mkdir -p bin/dasm-$timestamp-win-x86 |
| 29 | + |
| 30 | +cp -a machines/ bin/dasm-$timestamp-linux-x64/ |
| 31 | +cp -a machines/ bin/dasm-$timestamp-linux-x86/ |
| 32 | +cp -a machines/ bin/dasm-$timestamp-osx-x64/ |
| 33 | +cp -a machines/ bin/dasm-$timestamp-osx-x86/ |
| 34 | +cp -a machines/ bin/dasm-$timestamp-win-x64/ |
| 35 | +cp -a machines/ bin/dasm-$timestamp-win-x86/ |
| 36 | + |
| 37 | +cp -a bin/64bit/dasm.Linux bin/dasm-$timestamp-linux-x64/dasm |
| 38 | +cp -a bin/32bit/dasm.Linux bin/dasm-$timestamp-linux-x86/dasm |
| 39 | +cp -a bin/64bit/dasm.macOS bin/dasm-$timestamp-osx-x64/dasm |
| 40 | +cp -a bin/32bit/dasm.macOS bin/dasm-$timestamp-osx-x86/dasm |
| 41 | +cp -a bin/64bit/dasm.exe bin/dasm-$timestamp-win-x64/dasm.exe |
| 42 | +cp -a bin/32bit/dasm.exe bin/dasm-$timestamp-win-x86/dasm.exe |
| 43 | + |
| 44 | +cd bin/dasm-$timestamp-linux-x64 |
| 45 | +tar -zcvf ../../snapshot-builds/dasm-$timestamp-linux-x64.tar.gz * |
| 46 | +cd ../dasm-$timestamp-linux-x86 |
| 47 | +tar -zcvf ../../snapshot-builds/dasm-$timestamp-linux-x86.tar.gz * |
| 48 | +cd ../dasm-$timestamp-osx-x64 |
| 49 | +tar -zcvf ../../snapshot-builds/dasm-$timestamp-osx-x64.tar.gz * |
| 50 | +cd ../dasm-$timestamp-osx-x86 |
| 51 | +tar -zcvf ../../snapshot-builds/dasm-$timestamp-osx-x86.tar.gz * |
| 52 | +cd ../dasm-$timestamp-win-x64 |
| 53 | +tar -zcvf ../../snapshot-builds/dasm-$timestamp-win-x64.tar.gz * |
| 54 | +cd ../dasm-$timestamp-win-x86 |
| 55 | +tar -zcvf ../../snapshot-builds/dasm-$timestamp-win-x86.tar.gz * |
| 56 | + |
| 57 | +# cd back to dasm root |
| 58 | +cd ../.. |
| 59 | + |
| 60 | +# add the snapshots builds |
| 61 | +git add snapshot-builds/. |
| 62 | + |
| 63 | +# commit and push back to branch |
| 64 | +git commit -m "Added snapshot builds - $timestamp" |
| 65 | +git push origin $1 |
0 commit comments