Skip to content

Commit

Permalink
fix: some more
Browse files Browse the repository at this point in the history
Signed-off-by: Ramkumar Chinchani <[email protected]>
  • Loading branch information
rchincha committed Jun 10, 2023
1 parent fbceea6 commit 1b46540
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,49 @@ jobs:
go-version: ${{fromJson(inputs.go-version)}}
privilege-level: ${{fromJson(inputs.privilege-level)}}
build-id: ${{fromJson(inputs.build-id)}}
arch: ["aarch64"]
name: "golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }}"
steps:
- uses: actions/checkout@v3
- uses: benjlevesque/[email protected]
id: short-sha
- uses: uraimo/run-on-arch-action@v2
name: Run commands
name: Build for ${{ matrix.arch }}
id: runcmd
with:
arch: aarch64
arch: ${{ matrix.arch }}
distro: ubuntu22.04

# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}

dockerRunArgs: -v $GITHUB_WORKSPACE:/src

# Set an output parameter `uname` for use in subsequent steps
run: |
uname -a
echo ::set-output name=uname::$(uname -a)
# setup golang
apt-get update
apt-get install -yy wget curl tar software-properties-common git pkgconf build-essential
cd /tmp
wget -N https://go.dev/dl/go1.20.5.linux-arm64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.5.linux-arm64.tar.gz
export PATH=$PATH:/usr/local/go/bin
# install dependencies
export GOPATH=/src
add-apt-repository -y ppa:project-machine/squashfuse
apt-get update
apt-get install -yy lxc-utils lxc-dev libacl1-dev jq libcap-dev libseccomp-dev libpam-dev bats parallel libzstd-dev
GO111MODULE=off go get github.com/opencontainers/umoci/cmd/umoci
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
apt-get install -yy autoconf automake make autogen autoconf libtool binutils git squashfs-tools libcryptsetup-dev libdevmapper-dev cryptsetup-bin squashfuse
cd /src
make go-download
make show-info
make stacker-dynamic VERSION_FULL=${{ matrix.build-id }}
make stacker VERSION_FULL=${{ matrix.build-id }} STACKER_BUILD_BASE_IMAGE=docker://arm64v8/alpine:edge
- name: Get the output
# Echo the `uname` output parameter from the `runcmd` step
run: |
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ BUILD_D = $(TOP_LEVEL)/.build
export GOPATH = $(BUILD_D)/gopath
export GOCACHE = $(GOPATH)/gocache

OS ?= linux
ARCH ?= amd64

GO_SRC=$(shell find pkg cmd -name \*.go)
VERSION?=$(shell git describe --tags || git rev-parse HEAD)
VERSION_FULL?=$(if $(shell git status --porcelain --untracked-files=no),$(VERSION)-dirty,$(VERSION))
Expand All @@ -16,7 +13,7 @@ BUILD_TAGS = exclude_graphdriver_btrfs exclude_graphdriver_devicemapper containe

STACKER_OPTS=--oci-dir=$(BUILD_D)/oci --roots-dir=$(BUILD_D)/roots --stacker-dir=$(BUILD_D)/stacker --storage-type=overlay

build_stacker = GOOS=$(OS) GOARCH=$(ARCH) go build -tags "$(BUILD_TAGS) $1" -ldflags "-X main.version=$(VERSION_FULL) -X main.lxc_version=$(LXC_VERSION) $2" -o $3 ./cmd/stacker
build_stacker = go build -buildvcs=false -tags "$(BUILD_TAGS) $1" -ldflags "-X main.version=$(VERSION_FULL) -X main.lxc_version=$(LXC_VERSION) $2" -o $3 ./cmd/stacker

STACKER_DOCKER_BASE?=docker://
STACKER_BUILD_BASE_IMAGE?=$(STACKER_DOCKER_BASE)alpine:edge
Expand Down

0 comments on commit 1b46540

Please sign in to comment.