From 311ffc5c38dee6cee5bd4a423ef00f06057477dd Mon Sep 17 00:00:00 2001 From: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Date: Mon, 5 Aug 2024 09:18:55 -0400 Subject: [PATCH 1/2] Release OpAMP Supervisor --- .github/workflows/release-supervisor.yaml | 29 +++++++++++++++++ opampsupervisor/.gitignore | 1 + opampsupervisor/.goreleaser.yml | 39 +++++++++++++++++++++++ opampsupervisor/Makefile | 10 ++++++ 4 files changed, 79 insertions(+) create mode 100644 .github/workflows/release-supervisor.yaml create mode 100644 opampsupervisor/.gitignore create mode 100644 opampsupervisor/.goreleaser.yml create mode 100644 opampsupervisor/Makefile diff --git a/.github/workflows/release-supervisor.yaml b/.github/workflows/release-supervisor.yaml new file mode 100644 index 000000000..485981df7 --- /dev/null +++ b/.github/workflows/release-supervisor.yaml @@ -0,0 +1,29 @@ +name: Release OpAMP Supervisor +on: + push: + tags: + - "v*" + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout Releases Repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + with: + go-version: ~1.21.5 + - name: Grab the Supervisor sources + run: make -C opampsupervisor getsource TAG_NAME=${{ github.ref_name }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 + with: + distribution: goreleaser-pro + version: latest + args: release --clean -f opampsupervisor/.goreleaser.yml + env: + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/opampsupervisor/.gitignore b/opampsupervisor/.gitignore new file mode 100644 index 000000000..85de9cf93 --- /dev/null +++ b/opampsupervisor/.gitignore @@ -0,0 +1 @@ +src diff --git a/opampsupervisor/.goreleaser.yml b/opampsupervisor/.goreleaser.yml new file mode 100644 index 000000000..588c99a13 --- /dev/null +++ b/opampsupervisor/.goreleaser.yml @@ -0,0 +1,39 @@ +before: + hooks: + - go mod download +monorepo: + dir: ./src +builds: + - main: ./src + flags: + - -trimpath + ldflags: + - -s -w + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + - ppc64le + ignore: + - goos: windows + goarch: arm64 + binary: opampsupervisor +release: + github: + owner: open-telemetry + name: opentelemetry-collector-releases + header: | + ### OpAMP Supervisor Release +archives: + - format: binary +checksum: + name_template: "checksums.txt" +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + disable: true diff --git a/opampsupervisor/Makefile b/opampsupervisor/Makefile new file mode 100644 index 000000000..635c614a6 --- /dev/null +++ b/opampsupervisor/Makefile @@ -0,0 +1,10 @@ +TAG_NAME := "" +SUPERVISOR_MODULE := github.com/open-telemetry/opentelemetry-collector-contrib/cmd/opampsupervisor@$(TAG_NAME) + +src/go.sum: + go install $(SUPERVISOR_MODULE) + cp -r $$(go env GOMODCACHE)/$(SUPERVISOR_MODULE) . + chmod +w opampsupervisor@$(TAG_NAME) + mv opampsupervisor@$(TAG_NAME) src + +getsource: src/go.sum From 6f32c11ef8f12ee906653d4ae0fb06df769e1536 Mon Sep 17 00:00:00 2001 From: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:19:14 -0400 Subject: [PATCH 2/2] Only release Linux on amd64 for now --- opampsupervisor/.goreleaser.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/opampsupervisor/.goreleaser.yml b/opampsupervisor/.goreleaser.yml index 588c99a13..5c3715e5e 100644 --- a/opampsupervisor/.goreleaser.yml +++ b/opampsupervisor/.goreleaser.yml @@ -13,15 +13,8 @@ builds: - CGO_ENABLED=0 goos: - linux - - windows - - darwin goarch: - amd64 - - arm64 - - ppc64le - ignore: - - goos: windows - goarch: arm64 binary: opampsupervisor release: github: