Skip to content

Commit

Permalink
fix: Polish release workflow (#1843)
Browse files Browse the repository at this point in the history
* polish v2 release

* rearrange comment

* ci

* reduce build size

* ci
  • Loading branch information
dpaasman00 authored Sep 10, 2024
1 parent 7d76378 commit ccda1e3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 55 deletions.
61 changes: 7 additions & 54 deletions .github/workflows/multi_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,18 @@ on:
pull_request:

jobs:
setup-tools:
runs-on: "ubuntu-20.04"
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.sum') }}
- name: Install Tools
if: steps.tool-cache.outputs.cache-hit != 'true'
run: make install-tools

build_linux:
runs-on: ubuntu-latest-4-cores
needs:
- setup-tools
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Install Go
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.sum') }}
- name: Install Tools
if: steps.tool-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Install Builder
run: make install-builder
- name: Build
run: make build-linux
- name: Scan Third Party Dependency Licenses
Expand All @@ -56,8 +27,6 @@ jobs:
build_darwin:
runs-on: macos-14
needs:
- setup-tools
steps:
- name: Checkout Sources
uses: actions/checkout@v4
Expand All @@ -66,15 +35,8 @@ jobs:
with:
go-version: "1.21"
check-latest: true
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.sum') }}
- name: Install Tools
if: steps.tool-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Install Builder
run: make install-builder
- name: Build
run: make build-darwin
- name: Scan Third Party Dependency Licenses
Expand All @@ -84,8 +46,6 @@ jobs:
build_windows:
runs-on: ubuntu-20.04
needs:
- setup-tools
steps:
- name: Checkout Sources
uses: actions/checkout@v4
Expand All @@ -94,15 +54,8 @@ jobs:
with:
go-version: "1.21"
check-latest: true
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.sum') }}
- name: Install Tools
if: steps.tool-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Install Builder
run: make install-builder
- name: Build
run: make build-windows
- name: Scan Third Party Dependency Licenses
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
with:
go-version: "1.21"
check-latest: true
- name: Install Tools
run: make install-tools
# Needed until supervisor binary is released
- name: Build Supervisor Binary
run: make release-prep
Expand Down Expand Up @@ -113,6 +115,8 @@ jobs:
shell: bash
env:
COSIGN_PASSWORD: ${{ secrets.ORG_COSIGN_PWD }}
- name: Install Tools
run: make install-tools
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ install-tools:
# update cosign in docs/verify-signature.md when updating this version
go install github.com/sigstore/cosign/cmd/[email protected]

# install builder cmd for better CI
.PHONY: install-builder
install-builder:
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/collector/cmd/builder

.PHONY: lint
lint:
revive -config revive/config.toml -formatter friendly ./...
Expand Down Expand Up @@ -233,7 +238,7 @@ release-prep:
@rm -rf release_deps
@mkdir release_deps
@echo 'v$(CURR_VERSION)' > release_deps/VERSION.txt
./buildscripts/download-dependencies.sh release_deps
bash ./buildscripts/download-dependencies.sh release_deps
@cp -r ./plugins release_deps/
@cp service/com.observiq.collector.plist release_deps/com.observiq.collector.plist
@jq ".files[] | select(.service != null)" windows/wix.json >> release_deps/windows_service.json
Expand Down

0 comments on commit ccda1e3

Please sign in to comment.