From a30ac6d44bfb340af6f4d7a2179072ab5e1c6f08 Mon Sep 17 00:00:00 2001 From: Karmanyaah Malhotra Date: Fri, 24 Dec 2021 22:01:48 -0600 Subject: [PATCH] Move cross compilation into docker dependency --- .github/workflows/build.yml | 4 +--- Makefile | 26 ++++---------------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 552b085..5e03898 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/Makefile b/Makefile index d3df1d2..b40e9f4 100644 --- a/Makefile +++ b/Makefile @@ -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