Skip to content

Commit fb67f2d

Browse files
committed
Cleanup of goreleaser files
1 parent cb5a0d2 commit fb67f2d

File tree

6 files changed

+24
-221
lines changed

6 files changed

+24
-221
lines changed

.github/actions/tagged_release/docker/codesign/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: "Sign Osctrl Docker images"
2-
description: "Sign Osctrl Docker images"
1+
name: "Sign osctrl Docker images"
2+
description: "Sign osctrl Docker images"
33
inputs:
44
osctrl_component:
55
required: true

.github/workflows/test-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ jobs:
3939
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4040
with:
4141
name: osctrl-binaries
42-
path: bin/
42+
path: dist/
4343
retention-days: 1

.goreleaser.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
14
version: 2
25

36
before:

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ CLI_CODE = ${CLI_DIR:=/*.go}
2121
DEST ?= /opt/osctrl
2222

2323
OUTPUT = bin
24+
DIST = dist
2425

2526
STATIC_ARGS = -ldflags "-linkmode external -extldflags -static"
2627

27-
.PHONY: build static clean tls admin cli api release release-build release-check release-init
28+
.PHONY: build static clean tls admin cli api release release-build release-check release-init clean-dist
2829

2930
# Build code according to caller OS and architecture
3031
build:
@@ -72,12 +73,17 @@ cli:
7273
cli-static:
7374
go build $(STATIC_ARGS) -o $(OUTPUT)/$(CLI_NAME) -a $(CLI_CODE)
7475

76+
# Clean the dist directory
77+
clean-dist:
78+
rm -rf $(DIST)
79+
7580
# Delete all compiled binaries
7681
clean:
7782
rm -rf $(OUTPUT)/$(TLS_NAME)
7883
rm -rf $(OUTPUT)/$(ADMIN_NAME)
7984
rm -rf $(OUTPUT)/$(API_NAME)
8085
rm -rf $(OUTPUT)/$(CLI_NAME)
86+
clean-dist
8187

8288
# Dekete all dependencies go.sum files
8389
clean_go:
@@ -265,6 +271,7 @@ test_cover:
265271

266272
# Build snapshot binaries with GoReleaser
267273
release-build:
274+
clean-dist
268275
./tools/gorelease.sh build
269276

270277
# Check GoReleaser configuration
@@ -277,11 +284,12 @@ release-init:
277284

278285
# Create a release (requires tag)
279286
release:
287+
clean-dist
280288
./tools/gorelease.sh release
281289

282290
# Build and test release locally
283291
release-test:
284-
./tools/gorelease.sh build
292+
release-build
285293
@echo "Testing built binaries..."
286294
@for binary in dist/*/osctrl-*; do \
287295
if [ -f "$$binary" ] && [ -x "$$binary" ]; then \

RELEASE.md

Lines changed: 0 additions & 213 deletions
This file was deleted.

tools/gorelease.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
#
3+
# Helper script to use GoReleaser for building and releasing osctrl
4+
#
5+
# Usage: ./gorelease.sh [-h|--help|help] [COMMAND]
26

7+
# Stop script on error
38
set -e
49

510
# Colors for output
@@ -66,7 +71,7 @@ show_usage() {
6671
# Function to build snapshot
6772
build_snapshot() {
6873
print_status "Building snapshot binaries..."
69-
goreleaser build --snapshot --clean --rm-dist
74+
goreleaser build --snapshot --clean
7075
print_status "Build completed! Check the dist/ directory."
7176
}
7277

@@ -109,7 +114,7 @@ create_release() {
109114
fi
110115

111116
# Create release
112-
goreleaser release --clean --rm-dist
117+
goreleaser release --clean
113118
print_status "Release created successfully!"
114119
}
115120

0 commit comments

Comments
 (0)