From 73e5c1ec8b22e61d254d084d7325255809bd3432 Mon Sep 17 00:00:00 2001 From: Zack Brady Date: Tue, 1 Oct 2024 20:07:02 -0400 Subject: [PATCH] trying new workflow build processes (#337) * trying new workflow build processes * added last bit to new try --- .github/workflows/release.yaml | 10 +++++----- .github/workflows/tests.yaml | 1 - .goreleaser.yaml | 6 ++++++ Makefile | 11 ++++------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 100d6778..02b68be7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -42,7 +42,7 @@ jobs: name: Container Release Job runs-on: ubuntu-latest needs: [go-release] - timeout-minutes: 60 + timeout-minutes: 240 steps: - name: Checkout uses: actions/checkout@v4 @@ -74,8 +74,8 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and Push Release Container to GitHub Container Registry - uses: docker/build-push-action@v5 + - name: Build and Push Release Container to GitHub Container Registry/DockerHub Container Registry + uses: docker/build-push-action@v6 with: context: . target: release @@ -83,8 +83,8 @@ jobs: push: true tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}, docker.io/hauler/hauler:${{ github.ref_name }} - - name: Build and Push Debug Container to GitHub Container Registry - uses: docker/build-push-action@v5 + - name: Build and Push Debug Container to GitHub Container Registry/DockerHub Container Registry + uses: docker/build-push-action@v6 with: context: . target: debug diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d6f7d003..10a8ec1f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,7 +31,6 @@ jobs: go-version-file: go.mod check-latest: true - - name: Install Go Releaser uses: goreleaser/goreleaser-action@v6 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 519d28d3..c3e38829 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -3,8 +3,14 @@ version: 2 project_name: hauler before: hooks: + - rm -rf cmd/hauler/binaries + - mkdir -p cmd/hauler/binaries + - touch cmd/hauler/binaries/file - go mod tidy - go mod download + - go fmt ./... + - go vet ./... + - go test ./... -cover -race -covermode=atomic -coverprofile=coverage.out - rm -rf cmd/hauler/binaries release: diff --git a/Makefile b/Makefile index 5adc0b77..9e8178e0 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,9 @@ SHELL=/bin/bash # set go variables -GO_FILES=$(shell go list ./... | grep -v /vendor/) +GO_FILES=./... GO_COVERPROFILE=coverage.out -# set cosign variables -COSIGN_VERSION=v2.2.3+carbide.3 - # set build variables BIN_DIRECTORY=bin DIST_DIRECTORY=dist @@ -17,19 +14,19 @@ BINARIES_DIRECTORY=cmd/hauler/binaries # builds hauler for current platform # references other targets -build: install fmt vet test +build: goreleaser build --clean --snapshot --parallelism 1 --single-target # builds hauler for all platforms # references other targets -build-all: install fmt vet test +build-all: goreleaser build --clean --snapshot --parallelism 1 # install depedencies install: rm -rf $(BINARIES_DIRECTORY) mkdir -p $(BINARIES_DIRECTORY) - date > $(BINARIES_DIRECTORY)/date.txt + touch cmd/hauler/binaries/file go mod tidy go mod download CGO_ENABLED=0 go install ./cmd/...