Skip to content

Commit

Permalink
trying new workflow build processes (#337)
Browse files Browse the repository at this point in the history
* trying new workflow build processes
* added last bit to new try
  • Loading branch information
zackbradys authored Oct 2, 2024
1 parent 25d8cb8 commit 73e5c1e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -74,17 +74,17 @@ 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
platforms: linux/amd64,linux/arm64
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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
go-version-file: go.mod
check-latest: true


- name: Install Go Releaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
6 changes: 6 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,29 @@
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
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/...
Expand Down

0 comments on commit 73e5c1e

Please sign in to comment.