Skip to content

Commit

Permalink
lets go darwin?
Browse files Browse the repository at this point in the history
  • Loading branch information
phendryx committed Dec 28, 2022
1 parent 5c11926 commit 6ef68b7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 64 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
- name: Build
run: make build-darwin
run: ./scripts/build-and-copy-darwin.sh
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
Expand Down
31 changes: 31 additions & 0 deletions Dockerfile.build.darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM multiarch/crossbuild:latest

# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
ca-certificates \
wget \
git \
build-essential \
mingw-w64 \
nsis \
&& rm -rf /var/lib/apt/lists/*

ENV GOLANG_VERSION 1.14

RUN cd /usr/local && wget https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz && \
tar zxf go${GOLANG_VERSION}.linux-amd64.tar.gz && rm go${GOLANG_VERSION}.linux-amd64.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/

ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH

COPY . /usr/src/app
RUN cd /usr/src/app && echo "meh" && make build-darwin
4 changes: 4 additions & 0 deletions scripts/build-and-copy-darwin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker build -f ./Dockerfile.build.darwin -t albiondataclient-darwin .
docker run --name builder albiondataclient-darwin
docker cp builder:/usr/src/app/update-darwin-amd64.gz ./update-darwin-amd64.gz
docker cp builder:/usr/src/app/albiondata-client-amd64-mac.zip ./albiondata-client-amd64-mac.zip
60 changes: 1 addition & 59 deletions scripts/build-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,7 @@

set -eo pipefail

# apt-get update && sudo apt-get install -y libpcap-dev zip

sudo dpkg --add-architecture arm64 \
&& sudo dpkg --add-architecture armel \
&& sudo dpkg --add-architecture armhf \
&& sudo dpkg --add-architecture i386 \
&& sudo dpkg --add-architecture mips \
&& sudo dpkg --add-architecture mipsel \
&& sudo dpkg --add-architecture powerpc \
&& sudo dpkg --add-architecture ppc64el \
&& sudo apt-get update \
&& sudo apt-get install -y -q \
autoconf \
automake \
autotools-dev \
bc \
binfmt-support \
binutils-multiarch \
binutils-multiarch-dev \
build-essential \
clang \
crossbuild-essential-arm64 \
crossbuild-essential-armel \
crossbuild-essential-armhf \
crossbuild-essential-mipsel \
crossbuild-essential-ppc64el \
curl \
devscripts \
gdb \
git-core \
libtool \
llvm \
mercurial \
multistrap \
patch \
software-properties-common \
subversion \
wget \
xz-utils \
cmake \
qemu-user-static \
libxml2-dev \
lzma-dev \
openssl \
libssl-dev \

sudo apt-get update && sudo apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
ca-certificates \
wget \
git \
build-essential \
mingw-w64 \
nsis
apt-get update && apt-get install -y libpcap-dev zip

export OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1
export MACOSX_DEPLOYMENT_TARGET=10.6
Expand Down Expand Up @@ -87,7 +30,6 @@ cp -v run.command ./$TEMP/run.command
chown -Rv ${USER}:${USER} ./$TEMP
chmod -v 777 ./$TEMP/*
zip -v ../$ZIPNAME -r ./"$TEMP"
ls -la

# In theory the following works to create an app but there was a permissions issue when opening on the mac
# APP_NAME="Albion Data Client"
Expand Down

0 comments on commit 6ef68b7

Please sign in to comment.