-
Notifications
You must be signed in to change notification settings - Fork 876
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and attach release binaries in GH Action (#945)
- Loading branch information
Showing
6 changed files
with
83 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release-binaries: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.23' | ||
|
||
- name: Build binaries | ||
run: | | ||
make build-all-binaries | ||
ls -la | ||
./package-github-binaries.sh | ||
ls -la dist/ | ||
- name: Add binaries to release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "dist/*" | ||
allowUpdates: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,18 +13,18 @@ docker-all: docker-env-up docker-test docker-env-down | |
|
||
.PHONY: docker-env-up | ||
docker-env-up: | ||
$(DOCKER_COMPOSE) -f contrib/docker-compose-for-tests.yml up -d | ||
$(DOCKER_COMPOSE) -f docker-compose.yml up -d | ||
|
||
|
||
.PHONY: docker-env-down | ||
docker-env-down: | ||
$(DOCKER_COMPOSE) -f contrib/docker-compose-for-tests.yml down | ||
$(DOCKER_COMPOSE) -f docker-compose.yml down | ||
|
||
|
||
.PHONY: docker-test | ||
docker-test: | ||
$(DOCKER_COMPOSE) -f contrib/docker-compose-for-tests.yml up -d | ||
$(DOCKER_COMPOSE) -f contrib/docker-compose-for-tests.yml run --rm tests bash -c 'make test' | ||
$(DOCKER_COMPOSE) -f docker-compose.yml up -d | ||
$(DOCKER_COMPOSE) -f docker-compose.yml run --rm tests bash -c 'make test' | ||
|
||
|
||
|
||
|
@@ -68,14 +68,6 @@ mixin: | |
$(MAKE) all && \ | ||
cd ../../ | ||
|
||
.PHONY: upload-coverage | ||
upload-coverage: | ||
go install github.com/mattn/[email protected] | ||
which goveralls | ||
echo $PATH | ||
/home/runner/go/bin/goveralls -coverprofile=coverage.txt -service=drone.io | ||
|
||
|
||
|
||
BUILD_DT:=$(shell date +%F-%T) | ||
GO_LDFLAGS:="-s -w -extldflags \"-static\" -X main.BuildVersion=${DRONE_TAG} -X main.BuildCommitSha=${DRONE_COMMIT_SHA} -X main.BuildDate=$(BUILD_DT)" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -u -e -o pipefail | ||
|
||
mkdir -p dist | ||
|
||
for build in $(ls .build); do | ||
echo "Creating archive for ${build}" | ||
|
||
cp LICENSE README.md ".build/${build}/" | ||
|
||
if [[ "${build}" =~ windows-.*$ ]] ; then | ||
|
||
# Make sure to clear out zip files to prevent zip from appending to the archive. | ||
rm "dist/${build}.zip" || true | ||
cd ".build/" && zip -r --quiet -9 "../dist/${build}.zip" "${build}" && cd ../ | ||
else | ||
tar -C ".build/" -czf "dist/${build}.tar.gz" "${build}" | ||
fi | ||
done | ||
|
||
cd dist | ||
sha256sum *.gz *.zip > sha256sums.txt | ||
ls -la | ||
cd .. | ||
|