From b8ad31e3666e950431563b8f72cd05ad688bfb51 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 5 Sep 2022 10:58:42 +0200 Subject: [PATCH] update ci --- .woodpecker.yml | 5 ++++- Makefile | 14 +++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index d5357ae..c6271b9 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -8,6 +8,9 @@ pipeline: image: golang:1.18 commands: - make + - mkdir release + - tar cz release/build-amd64.tar.gz build/linux-amd64/ + - tar cz release/build-arm64.tar.gz build/linux-arm64/ release: image: plugins/gitea-release @@ -16,6 +19,6 @@ pipeline: from_secret: gitnet_api_key base_url: https://gitnet.fr note: - files: build/* + files: release/* when: event: [tag] diff --git a/Makefile b/Makefile index 4e2a319..2f760cd 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,16 @@ +all: linux-amd64 linux-arm64 + .ONESHELL: -all: +linux-amd64: for i in blocks/*; do - go build -ldflags '-s -w' -v -o "build/$$(basename "$$i")" "$$i/main.go" + GOARCH=amd64 GOOS=linux go build -ldflags '-s -w' -v -o "build/linux-amd64/$$(basename "$$i")" "$$i/main.go" + done + +.ONESHELL: +linux-arm64: + for i in blocks/*; do + GOARCH=arm64 GOOS=linux go build -ldflags '-s -w' -v -o "build/linux-arm64/$$(basename "$$i")" "$$i/main.go" done clean: - rm build/* 2>/dev/null || true + rm -fr build/* 2>/dev/null || true