Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .env

This file was deleted.

28 changes: 28 additions & 0 deletions .github/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
categories:
- title: 'Features'
labels:
- 'feature'
- 'enhancement'
- title: 'Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: 'Maintenance'
label: 'chore'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
$CHANGES
28 changes: 28 additions & 0 deletions .github/workflows/library-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Library build

# Controls when the workflow will run
on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '^1.24.5' # The Go version to download (if necessary) and use.

- name: Build code
run: |
make build

- name: Test code
run: |
make test
61 changes: 61 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release module

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches:
- main

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4

# Drafts your next Release notes as Pull Requests are merged into "main"
- name: Create release
id: create-release
uses: release-drafter/release-drafter@v6
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: release-drafter.yaml
publish: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '^1.24.5' # The Go version to download (if necessary) and use.

- name: Update version
run: |
TAG_NAME=$(echo "${{ steps.create-release.outputs.tag_name }}" | sed "s/v//g")
cat Makefile | sed "s/^VERSION .*/VERSION ?= ${TAG_NAME}/g" > /tmp/Makefile
diff Makefile /tmp/Makefile && echo "" || echo ""
cp /tmp/Makefile Makefile

git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

git add -u

git commit -m "Update version to ${TAG_NAME} Makefile"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish release
id: publish-release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
release_id: ${{ steps.create-release.outputs.id }}
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
include .env
# Environment variables for the build process

PROJECTNAME=go-collections

MODULE=github.com/cloud-native-toolkit/go-collections

# Go related variables.
GOBASE=$(shell pwd)
GOPATH=$(GOBASE)/vendor:$(GOBASE) # You can remove or change the path after last colon.
GOBIN=$(GOBASE)/bin
GOFILES=$(wildcard *.go)
GOTESTS=$(shell find . -name "*_test.go" | grep -v vendor | xargs -I{} dirname {} | sed -E "s~[.]~${MODULE}~g")
VERSION ?= v0.0.0

# Redirect error output to a file, so we can show it in development mode.
STDERR=/tmp/.$(PROJECTNAME)-stderr.txt

# PID file will store the server process id when it's running on development mode
PID=/tmp/.$(PROJECTNAME)-api-server.pid

# Make is verbose in Linux. Make it silent.
MAKEFLAGS += --silent


go-compile: go-clean go-get go-build

Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/cloud-native-toolkit/go-collections

go 1.23.0

toolchain go1.24.4
go 1.24.5

require (
github.com/onsi/ginkgo/v2 v2.23.4
Expand Down