Skip to content

Commit

Permalink
release cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver006 committed Sep 9, 2024
1 parent 2831e15 commit ad70547
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 79 deletions.
33 changes: 0 additions & 33 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,36 +351,3 @@ steps:
- tag
depends_on:
- manifest-quay-tag


# this builds the binaries that get uploaded to GH for a release
# docker binaries are build in docker itself via multi-stage Docker files
- name: build-all-binaries
image: golang:1.23
pull: if-not-exists
environment:
GO111MODULE: on
LOG_LEVEL: "info"
commands:
- make build-all-binaries
when:
event:
- tag
depends_on:
- start

- name: release-github-binaries
image: golang:1.23
pull: if-not-exists
environment:
GITHUB_TOKEN:
from_secret: github_token
GO111MODULE: on
commands:
- "apt-get update && apt-get install -y zip"
- "./release-github-binaries.sh"
when:
event:
- tag
depends_on:
- build-all-binaries
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:
go-version: '1.23'

- name: Build binaries
env:
RELEASE_TAG: ${{ env.GITHUB_REF_NAME }}
run: |
env
make build-all-binaries
ls -la
./package-github-binaries.sh
Expand All @@ -30,3 +33,4 @@ jobs:
with:
artifacts: "dist/*"
allowUpdates: true
omitBodyDuringUpdate: true
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ mixin:


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)"
GO_LDFLAGS:="-s -w -extldflags \"-static\" -X main.BuildVersion=${RELEASE_TAG} -X main.BuildCommitSha=${DRONE_COMMIT_SHA} -X main.BuildDate=$(BUILD_DT)"


.PHONE: build-some-amd64-binaries
Expand All @@ -80,7 +80,7 @@ build-some-amd64-binaries:
rm -rf .build | true

export CGO_ENABLED=0 ; \
gox -os="linux windows" -arch="amd64" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && echo "done"
gox -os="linux windows" -arch="amd64" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${RELEASE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && echo "done"


.PHONE: build-all-binaries
Expand All @@ -90,9 +90,9 @@ build-all-binaries:
rm -rf .build | true

export CGO_ENABLED=0 ; \
gox -os="linux windows freebsd netbsd openbsd" -arch="amd64 386" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="darwin solaris illumos" -arch="amd64" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="darwin" -arch="arm64" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="linux freebsd netbsd" -arch="arm" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="linux" -arch="arm64 mips64 mips64le ppc64 ppc64le s390x" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${DRONE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="linux windows freebsd netbsd openbsd" -arch="amd64 386" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${RELEASE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="darwin solaris illumos" -arch="amd64" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${RELEASE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="darwin" -arch="arm64" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${RELEASE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="linux freebsd netbsd" -arch="arm" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${RELEASE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
gox -os="linux" -arch="arm64 mips64 mips64le ppc64 ppc64le s390x" -verbose -rebuild -ldflags $(GO_LDFLAGS) -output ".build/redis_exporter-${RELEASE_TAG}.{{.OS}}-{{.Arch}}/{{.Dir}}" && \
echo "done"
39 changes: 0 additions & 39 deletions release-github-binaries.sh

This file was deleted.

0 comments on commit ad70547

Please sign in to comment.