Make makefile more targeted by refactoring. Add new multistage dockerfile

Remove separate targets for release.
Replace travis-ci with github-actions

Signed-off-by: Jguer <me@jguer.space>
This commit is contained in:
Jguer authored and J Guerreiro committed 2019-09-29 10:24:09 +01:00
1 parent de95a0e253
commit d0705a6d6b
12 files changed
+174 -139

No files matched your search

Vendored Executable
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
set -evx
# Objective of this script is to be the most vendor agnostic possible
# It builds and tests yay independently of hardware
export VERSION=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
export ARCH="x86_64"
docker build --build-arg BUILD_ARCH=${ARCH} --target builder_env -t yay-builder_env .
docker build --build-arg BUILD_ARCH=${ARCH} --target builder -t yay-builder .
# Our unit test and packaging container
docker run --name yay-go-tests yay-builder_env:latest make test
docker rm yay-go-tests
# docker run yay-builder make lint
# Build image for integration testing
docker build -t yay .
# Do integration testing
# TODO
# Create a release asset
docker run --name artifact_factory yay-builder make release ARCH=${ARCH} VERSION=${VERSION}
# Copy bin and release to workdir
docker cp artifact_factory:/app/yay yay
docker cp artifact_factory:/app/yay_${VERSION}_${ARCH}.tar.gz .
# Cleanup docker
docker rm artifact_factory