From 74074656bef2a6d8c5e040a949b98c16bede2e5d Mon Sep 17 00:00:00 2001 From: micha Date: Sat, 21 Feb 2026 00:48:20 +0100 Subject: [PATCH] Added license, and CI workflow for Gitea and GitHub Actions. --- .gitea/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ Makefile | 2 ++ README.md | 9 +++++++++ cmd/triplex-example/main.go | 2 ++ go.mod | 2 ++ serial/serial.go | 2 ++ serial/serial_test.go | 2 ++ 9 files changed, 109 insertions(+) create mode 100644 .gitea/workflows/ci.yml create mode 100644 .github/workflows/ci.yml create mode 100644 LICENSE diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..faec306 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches: ["**"] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Verify formatting + run: | + unformatted=$(gofmt -l .) + if [ -n "$unformatted" ]; then + echo "These files are not gofmt-formatted:" + echo "$unformatted" + exit 1 + fi + + - name: Vet + run: go vet ./... + + - name: Test + run: go test -v ./... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..18370f9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + branches: ["**"] + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Verify formatting + run: | + unformatted=$(gofmt -l .) + if [ -n "$unformatted" ]; then + echo "These files are not gofmt-formatted:" + echo "$unformatted" + exit 1 + fi + + - name: Vet + run: go vet ./... + + - name: Test + run: go test -v ./... diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4755a5b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Micha Hoiting + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile index cf93246..424eda9 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +# Copyright (c) 2026 Micha Hoiting + APP_EXAMPLE := triplex-example .PHONY: test build-example run-example fmt diff --git a/README.md b/README.md index 3e4e83b..62e9e8b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ +Copyright (c) 2026 Micha Hoiting + # triplex +[![Gitea CI](https://git.hoiting.org/micha/triplex/actions/workflows/ci.yml/badge.svg)](https://git.hoiting.org/micha/triplex/actions) +[![GitHub CI](https://github.com/micha/triplex/actions/workflows/ci.yml/badge.svg)](https://github.com/micha/triplex/actions/workflows/ci.yml) + `triplex` is a deterministic, reversible serial number engine for high-integrity identifiers. It maps a compact 32-bit integer space to a human-readable serial format: @@ -119,3 +124,7 @@ Run all tests: ```bash go test ./... ``` + +## License + +This project is licensed under the MIT License. See [LICENSE](LICENSE). diff --git a/cmd/triplex-example/main.go b/cmd/triplex-example/main.go index 6709105..c150e20 100644 --- a/cmd/triplex-example/main.go +++ b/cmd/triplex-example/main.go @@ -1,3 +1,5 @@ +// Copyright (c) 2026 Micha Hoiting + package main import ( diff --git a/go.mod b/go.mod index 1b6befb..e9dae74 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,5 @@ +// Copyright (c) 2026 Micha Hoiting + module git.hoiting.org/micha/triplex go 1.25.0 diff --git a/serial/serial.go b/serial/serial.go index a0ca049..4dc5598 100644 --- a/serial/serial.go +++ b/serial/serial.go @@ -1,3 +1,5 @@ +// Copyright (c) 2026 Micha Hoiting + package serial import ( diff --git a/serial/serial_test.go b/serial/serial_test.go index 98108c5..bca805c 100644 --- a/serial/serial_test.go +++ b/serial/serial_test.go @@ -1,3 +1,5 @@ +// Copyright (c) 2026 Micha Hoiting + package serial_test import (