Skip to content

Commit

Permalink
Move cross compilation into docker dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
karmanyaahm committed Dec 25, 2021
1 parent 0c55cf0 commit a30ac6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: docker://archlinux:base-devel
with:
args: make arch-container-init
- run: make build-docker
- name: Release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
26 changes: 4 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,7 @@ build-prod:
test: build-local
go test ./...

#Go compiling using CGo(sqlite) AND for Alpine on top of that created most of this confusion

archlinux-deps-prod: archlinux-deps-init archlinux-deps

archlinux-deps-init:
sudo pacman -Syu --needed --noconfirm git base-devel
mkdir -p ~/Downloads; \
cd ~/Downloads; \
git clone https://aur.archlinux.org/yay-bin.git; \
cd yay-bin; \
makepkg -si --noconfirm
archlinux-deps:
# aarch64 gnu - amd64 alpine - aarch64 alpine - 32bit gnu - 32 bit gnu - go
yay --noconfirm --needed -S aarch64-linux-gnu-gcc musl aarch64-linux-musl lib32-glibc lib32-gcc-libs go

arch-container-init:
echo 'ParallelDownloads=5' >> /etc/pacman.conf
useradd -m -s /bin/sh builder
pacman -Syu sudo --noconfirm --needed
echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
chmod ugo+rwx .
sudo -u builder make archlinux-deps-prod build-prod
build-docker:
mkdir bin
chmod ugo+rwx bin
docker run --rm -v `pwd`:/app ghcr.io/karmanyaahm/mega_go_arch_xcompiler:v0.2.1 build np2p

0 comments on commit a30ac6d

Please sign in to comment.