Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dionoid committed Dec 15, 2019
1 parent d8e572a commit be0aef7
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 2 deletions.
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Container image that runs your code

FROM dionoid/dasm-build:v1

# FROM ubuntu:16.04

# Install packages
# RUN apt update && apt upgrade -y &&\
# apt install -y curl &&\
# apt install -y make &&\
# apt install -y unzip &&\
# apt install -y git &&\
# apt install -y gcc &&\
# apt install -y gcc-multilib &&\
# apt install -y mingw-w64

#download darwin build packages
# 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 &&\
# curl -O http://www.tarnyko.net/repo/apple-x86-gcc-DEBIAN-AMD64.zip &&\
# unzip apple-x86-gcc-DEBIAN-AMD64.zip &&\
# export DEBIAN_FRONTEND=noninteractive &&\
# dpkg -i libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb &&\
# dpkg -i apple-uni-sdk-10.5_20110407-0.flosoft1_amd64.deb &&\
# dpkg -i apple-x86-odcctools_758.159-0flosoft11_amd64.deb &&\
# dpkg -i apple-x86-gcc_4.2.1~5646.1flosoft2_amd64.deb &&\
# rm *.zip &&\
# rm *.deb

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# dasm-snapshot-builder
This is a GitHub action to build DASM snapshots and automatically commit the packaged snapshots into the source branch
# DASM docker build action

This action builds DASM from a git branch, and commits the packaged snapshot releases back into the same branch.

## Only for internal usage
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# action.yml
name: 'DASM Snapshot Builder'
description: 'Builds DASM snapshots'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.branch }}
- ${{ inputs.username }}
- ${{ inputs.password }}
65 changes: 65 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/sh -l

# timestamp to use in name of snapshot builds
timestamp=$(date '+%Y%m%d%H%M%S')

# setup git user
git config --global user.email "[email protected]"
git config --global user.name "automated build"

# clone dasm branch
git clone --single-branch --branch $1 https://$2:$3@github.com/dasm-assembler/dasm.git

# build dasm binaries for all platforms
cd dasm/docker
./make_dasm_all_platforms.sh

# create empty snapshot-builds folder
cd ..
rm -r snapshot-builds
mkdir snapshot-builds

# create package folders for all platforms and tar gz 'm up
mkdir -p bin/dasm-$timestamp-linux-x64
mkdir -p bin/dasm-$timestamp-linux-x86
mkdir -p bin/dasm-$timestamp-osx-x64
mkdir -p bin/dasm-$timestamp-osx-x86
mkdir -p bin/dasm-$timestamp-win-x64
mkdir -p bin/dasm-$timestamp-win-x86

cp -a machines/ bin/dasm-$timestamp-linux-x64/
cp -a machines/ bin/dasm-$timestamp-linux-x86/
cp -a machines/ bin/dasm-$timestamp-osx-x64/
cp -a machines/ bin/dasm-$timestamp-osx-x86/
cp -a machines/ bin/dasm-$timestamp-win-x64/
cp -a machines/ bin/dasm-$timestamp-win-x86/

cp -a bin/64bit/dasm.Linux bin/dasm-$timestamp-linux-x64/dasm
cp -a bin/32bit/dasm.Linux bin/dasm-$timestamp-linux-x86/dasm
cp -a bin/64bit/dasm.macOS bin/dasm-$timestamp-osx-x64/dasm
cp -a bin/32bit/dasm.macOS bin/dasm-$timestamp-osx-x86/dasm
cp -a bin/64bit/dasm.exe bin/dasm-$timestamp-win-x64/dasm.exe
cp -a bin/32bit/dasm.exe bin/dasm-$timestamp-win-x86/dasm.exe

cd bin/dasm-$timestamp-linux-x64
tar -zcvf ../../snapshot-builds/dasm-$timestamp-linux-x64.tar.gz *
cd ../dasm-$timestamp-linux-x86
tar -zcvf ../../snapshot-builds/dasm-$timestamp-linux-x86.tar.gz *
cd ../dasm-$timestamp-osx-x64
tar -zcvf ../../snapshot-builds/dasm-$timestamp-osx-x64.tar.gz *
cd ../dasm-$timestamp-osx-x86
tar -zcvf ../../snapshot-builds/dasm-$timestamp-osx-x86.tar.gz *
cd ../dasm-$timestamp-win-x64
tar -zcvf ../../snapshot-builds/dasm-$timestamp-win-x64.tar.gz *
cd ../dasm-$timestamp-win-x86
tar -zcvf ../../snapshot-builds/dasm-$timestamp-win-x86.tar.gz *

# cd back to dasm root
cd ../..

# add the snapshots builds
git add snapshot-builds/.

# commit and push back to branch
git commit -m "Added snapshot builds - $timestamp"
git push origin $1

0 comments on commit be0aef7

Please sign in to comment.