Skip to content

Commit

Permalink
Merge pull request #39 from n8maninger/fix-build-in-docker
Browse files Browse the repository at this point in the history
Fixes build-in-docker.sh
  • Loading branch information
lukechampine authored Sep 21, 2021
2 parents 955d35c + 0423202 commit 985b664
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
7 changes: 4 additions & 3 deletions release-scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM golang@sha256:1e9c36b3fd7d7f9ab95835fb1ed898293ec0917e44c7e7d2766b4a2d9aa43da6
# golang:1.14.4-buster
FROM golang@sha256:0bf61ce389ea41b61ea9f2b2c8eb15824838782df0c9c302dc284f0d6792caf9
# golang:1.16.7-buster

ARG branch
ARG version

RUN useradd -ms /bin/bash builder
RUN chown -R builder:builder /home/builder
USER builder
WORKDIR /home/builder

RUN git clone https://github.com/SiaFoundation/siad
RUN git clone https://github.com/SiaFoundation/siad /home/builder/Sia
WORKDIR /home/builder/Sia
RUN git fetch --all && git checkout $branch

Expand Down
17 changes: 5 additions & 12 deletions release-scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,17 @@ if [[ -z $version ]]; then
exit 1
fi

# get the current directory to preserve paths.
dir=$(pwd)/release
# go up one directory to the makefile.
cd ..

function build {
os=$1
arch=$2

echo Building ${os}...
# create workspace
folder=$dir/Sia-$version-$os-$arch
folder=release/Sia-$version-$os-$arch
rm -rf $folder
mkdir -p $folder

GOOS=$1 GOARCH=$2 make static
mv release/* $folder

# compile and hash binaries
for pkg in siac siad; do
Expand All @@ -34,16 +28,15 @@ function build {
bin=${pkg}.exe
fi

mv release/$bin $folder

(
cd $dir
sha256sum Sia-$version-$os-$arch/$bin >> $dir/Sia-$version-SHA256SUMS.txt
cd release/
sha256sum Sia-$version-$os-$arch/$bin >> Sia-$version-SHA256SUMS.txt
)
done

cp -r doc LICENSE README.md $folder

# delete the top-level release folder from the makefile.
rm -rf release
}

# Build amd64 binaries.
Expand Down

0 comments on commit 985b664

Please sign in to comment.