Skip to content

Commit be0aef7

Browse files
committed
First commit
1 parent d8e572a commit be0aef7

4 files changed

Lines changed: 113 additions & 2 deletions

File tree

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Container image that runs your code
2+
3+
FROM dionoid/dasm-build:v1
4+
5+
# FROM ubuntu:16.04
6+
7+
# Install packages
8+
# RUN apt update && apt upgrade -y &&\
9+
# apt install -y curl &&\
10+
# apt install -y make &&\
11+
# apt install -y unzip &&\
12+
# apt install -y git &&\
13+
# apt install -y gcc &&\
14+
# apt install -y gcc-multilib &&\
15+
# apt install -y mingw-w64
16+
17+
#download darwin build packages
18+
# RUN curl -O http://security.ubuntu.com/ubuntu/pool/universe/o/openssl098/libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb &&\
19+
# curl -O http://www.tarnyko.net/repo/apple-x86-gcc-DEBIAN-AMD64.zip &&\
20+
# unzip apple-x86-gcc-DEBIAN-AMD64.zip &&\
21+
# export DEBIAN_FRONTEND=noninteractive &&\
22+
# dpkg -i libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb &&\
23+
# dpkg -i apple-uni-sdk-10.5_20110407-0.flosoft1_amd64.deb &&\
24+
# dpkg -i apple-x86-odcctools_758.159-0flosoft11_amd64.deb &&\
25+
# dpkg -i apple-x86-gcc_4.2.1~5646.1flosoft2_amd64.deb &&\
26+
# rm *.zip &&\
27+
# rm *.deb
28+
29+
# Copies your code file from your action repository to the filesystem path `/` of the container
30+
COPY entrypoint.sh /entrypoint.sh
31+
32+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
33+
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
# dasm-snapshot-builder
2-
This is a GitHub action to build DASM snapshots and automatically commit the packaged snapshots into the source branch
1+
# DASM docker build action
2+
3+
This action builds DASM from a git branch, and commits the packaged snapshot releases back into the same branch.
4+
5+
## Only for internal usage

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# action.yml
2+
name: 'DASM Snapshot Builder'
3+
description: 'Builds DASM snapshots'
4+
runs:
5+
using: 'docker'
6+
image: 'Dockerfile'
7+
args:
8+
- ${{ inputs.branch }}
9+
- ${{ inputs.username }}
10+
- ${{ inputs.password }}

entrypoint.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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

Comments
 (0)