move to codeberg (#22)

This commit is contained in:
T. von Dein
2025-11-03 09:15:27 +01:00
parent eb39f57199
commit a16b9e796c
26 changed files with 189 additions and 224 deletions

View File

@@ -1,56 +0,0 @@
name: build-and-test
#on: [push]
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
strategy:
matrix:
version: ['1.24']
os: [ubuntu-latest, macos-latest, windows-latest]
name: Build
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.version }}
id: go
- name: checkout
uses: actions/checkout@v5
- name: build
run: go build
- name: test
run: make test
- name: Update coverage report
uses: ncruces/go-coverage-report@main
with:
report: true
chart: true
amend: true
if: |
matrix.os == 'ubuntu-latest' &&
github.event_name == 'push'
continue-on-error: true
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v6
with:
go-version: 1.24
- uses: actions/checkout@v5
- name: golangci-lint
uses: golangci/golangci-lint-action@v8

View File

@@ -1,34 +0,0 @@
name: build-push-image
on:
push:
tags:
- 'v*'
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Log in to the Container registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
push: true
tags: ghcr.io/tlinden/anydb:${{ github.ref_name}}
- name: Build and push latest Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
push: true
tags: ghcr.io/tlinden/anydb:latest

View File

@@ -1,87 +0,0 @@
name: build-release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
name: Build Release Assets
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 1.24.1
- name: Build the executables
run: ./mkrel.sh anydb ${{ github.ref_name}}
- name: List the executables
run: ls -l ./releases
- name: Upload the binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
file: ./releases/*
file_glob: true
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mode: "PR"
configurationJson: |
{
"template": "#{{CHANGELOG}}\n\n**Full Changelog**: #{{RELEASE_DIFF}}",
"pr_template": "- #{{TITLE}} (##{{NUMBER}}) by #{{AUTHOR}}\n#{{BODY}}",
"empty_template": "- no changes",
"categories": [
{
"title": "## New Features",
"labels": ["add", "feature"]
},
{
"title": "## Bug Fixes",
"labels": ["fix", "bug", "revert"]
},
{
"title": "## Documentation Enhancements",
"labels": ["doc"]
},
{
"title": "## Refactoring Efforts",
"labels": ["refactor"]
},
{
"title": "## Miscellaneus Changes",
"labels": []
}
],
"ignore_labels": [
"duplicate", "good first issue", "help wanted", "invalid", "question", "wontfix"
],
"label_extractor": [
{
"pattern": "(.) (.+)",
"target": "$1"
},
{
"pattern": "(.) (.+)",
"target": "$1",
"on_property": "title"
}
]
}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body: ${{steps.github_release.outputs.changelog}}

69
.goreleaser.yaml Normal file
View File

@@ -0,0 +1,69 @@
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
before:
hooks:
- go mod tidy
gitea_urls:
api: https://codeberg.org/api/v1
download: https://codeberg.org
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
- freebsd
archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}_{{ .Tag }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]
- goos: linux
formats: [tar.gz,binary]
files:
- src: "*.md"
strip_parent: true
- src: "docs/*"
strip_parent: true
- src: Makefile.dist
dst: Makefile
wrap_in_directory: true
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
groups:
- title: Improved
regexp: '^.*?(feat|add|new)(\([[:word:]]+\))??!?:.+$'
order: 0
- title: Fixed
regexp: '^.*?(bug|fix)(\([[:word:]]+\))??!?:.+$'
order: 1
- title: Changed
order: 999
release:
header: "# Release Notes"
footer: >-
---
Full Changelog: [{{ .PreviousTag }}...{{ .Tag }}](https://codeberg.org/scip/epuppy/compare/{{ .PreviousTag }}...{{ .Tag }})

27
.woodpecker/build.yaml Normal file
View File

@@ -0,0 +1,27 @@
matrix:
platform:
- linux/amd64
goversion:
- 1.24
labels:
platform: ${platform}
steps:
build:
when:
event: [push]
image: golang:${goversion}
commands:
- go get
- go build
- go test
linter:
when:
event: [push]
image: golang:${goversion}
commands:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0
- golangci-lint --version
- golangci-lint run ./...

32
.woodpecker/image.yaml Normal file
View File

@@ -0,0 +1,32 @@
# https://woodpecker-ci.org/plugins/docker-buildx
# enable Package unit and go to /scip/-/packages after building to link to proj
variables:
- &repo codeberg.org/${CI_REPO_OWNER}/anydb
steps:
dryrun:
image: docker.io/woodpeckerci/plugin-docker-buildx:latest
settings:
dockerfile: Dockerfile
platforms: linux/amd64
dry_run: true
repo: *repo
tags: latest
when:
event: [pull_request]
publish:
image: docker.io/woodpeckerci/plugin-docker-buildx:latest
settings:
dockerfile: Dockerfile
platforms: linux/amd64
repo: *repo
registry: codeberg.org
tags: latest,${CI_COMMIT_SHA:0:8},${CI_COMMIT_TAG}
username: ${CI_REPO_OWNER}
password:
from_secret: REGISTRY_TOKEN
when:
event: [tag]
branch: main

15
.woodpecker/release.yaml Normal file
View File

@@ -0,0 +1,15 @@
# build release
labels:
platform: linux/amd64
steps:
goreleaser:
image: goreleaser/goreleaser
when:
event: [tag]
environment:
GITEA_TOKEN:
from_secret: DEPLOY_TOKEN
commands:
- goreleaser release --clean --verbose

View File

@@ -51,11 +51,11 @@ endif
app/dbentry.pb.go: app/dbentry.proto app/dbentry.pb.go: app/dbentry.proto
protoc -I=. --go_out=app app/dbentry.proto protoc -I=. --go_out=app app/dbentry.proto
mv app/github.com/tlinden/anydb/app/dbentry.pb.go app/dbentry.pb.go mv app/codeberg.org/scip/anydb/app/dbentry.pb.go app/dbentry.pb.go
rm -rf app/github.com rm -rf app/github.com
buildlocal: buildlocal:
go build -ldflags "-X 'github.com/tlinden/anydb/cfg.VERSION=$(VERSION)'" go build -ldflags "-X 'codeberg.org/scip/anydb/cfg.VERSION=$(VERSION)'"
# binaries are being built by ci workflow on tag creation # binaries are being built by ci workflow on tag creation
release: release:
@@ -75,7 +75,7 @@ test: clean
singletest: singletest:
@echo "Call like this: ''make singletest TEST=TestPrepareColumns MOD=lib" @echo "Call like this: ''make singletest TEST=TestPrepareColumns MOD=lib"
ANYDB_PASSWORD=test go test -run $(TEST) github.com/tlinden/anydb/$(MOD) ANYDB_PASSWORD=test go test -run $(TEST) codeberg.org/scip/anydb/$(MOD)
cover-report: cover-report:
go test ./... -cover -coverprofile=coverage.out go test ./... -cover -coverprofile=coverage.out

View File

@@ -1,11 +1,10 @@
## A personal key value store ## A personal key value store
[![Actions](https://github.com/tlinden/anydb/actions/workflows/ci.yaml/badge.svg)](https://github.com/tlinden/anydb/actions) [![status-badge](https://ci.codeberg.org/api/badges/15517/status.svg)](https://ci.codeberg.org/repos/15517)
[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://github.com/tlinden/anydb/blob/master/LICENSE) [![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://codeberg.org/scip/anydb/blob/master/LICENSE)
[![Go Coverage](https://github.com/tlinden/anydb/wiki/coverage.svg)](https://raw.githack.com/wiki/tlinden/anydb/coverage.html) [![Go Report Card](https://goreportcard.com/badge/codeberg.org/scip/anydb)](https://goreportcard.com/report/codeberg.org/scip/anydb)
[![Go Report Card](https://goreportcard.com/badge/github.com/tlinden/anydb)](https://goreportcard.com/report/github.com/tlinden/anydb) [![GitHub release](https://img.shields.io/github/v/release/tlinden/anydb?color=%2300a719)](https://codeberg.org/scip/anydb/releases)
[![GitHub release](https://img.shields.io/github/v/release/tlinden/anydb?color=%2300a719)](https://github.com/TLINDEN/anydb/releases/latest) [![Documentation](https://img.shields.io/badge/manpage-documentation-blue)](https://codeberg.org/scip/anydb/raw/branch/main/anydb.pod)
[![Documentation](https://img.shields.io/badge/manpage-documentation-blue)](https://github.com/TLINDEN/anydb/blob/master/anydb.pod)
> [!CAUTION] > [!CAUTION]
> Between version 0.1.0 and version 0.2.1 deletion of keys did not work. There > Between version 0.1.0 and version 0.2.1 deletion of keys did not work. There
@@ -14,7 +13,7 @@
> upgrade to 0.2.1 and above. > upgrade to 0.2.1 and above.
> [!CAUTION] > [!CAUTION]
> Version 0.1.3 introduced a [regression](https://github.com/TLINDEN/anydb/issues/19), > Version 0.1.3 introduced a [regression](https://codeberg.org/scip/anydb/issues/19),
> which caused the encryption feature not to work correctly anymore. > which caused the encryption feature not to work correctly anymore.
> If you are using anydb 0.1.3, you are urgently advised to > If you are using anydb 0.1.3, you are urgently advised to
> upgrade to 0.2.0 > upgrade to 0.2.0
@@ -47,17 +46,17 @@ And I wrote a very similar [tool](https://www.daemon.de/projects/dbtool/) 24 yea
**anydb** can do all the things you can do with skate: **anydb** can do all the things you can do with skate:
![simple demo](https://github.com/TLINDEN/anydb/blob/main/demo/intro.gif) ![simple demo](https://codeberg.org/scip/anydb/raw/branch/demo/intro.gif)
However, there are more features than just that! However, there are more features than just that!
![advanced demo](https://github.com/TLINDEN/anydb/blob/main/demo/advanced.gif) ![advanced demo](https://codeberg.org/scip/anydb/raw/branch/demo/advanced.gif)
## Installation ## Installation
There are multiple ways to install **anydb**: There are multiple ways to install **anydb**:
- Go to the [latest release page](https://github.com/tlinden/anydb/releases/latest), - Go to the [latest release page](https://codeberg.org/scip/anydb/releases),
locate the binary for your operating system and platform. locate the binary for your operating system and platform.
Download it and put it into some directory within your `$PATH` variable. Download it and put it into some directory within your `$PATH` variable.
@@ -70,7 +69,7 @@ There are multiple ways to install **anydb**:
- You can also install from source. Issue the following commands in your shell: - You can also install from source. Issue the following commands in your shell:
```shell ```shell
git clone https://github.com/TLINDEN/anydb.git git clone https://codeberg.org/scip/anydb.git
cd anydb cd anydb
make make
sudo make install sudo make install
@@ -78,7 +77,7 @@ There are multiple ways to install **anydb**:
- Or, if you have the GO toolkit installed, just install it like this: - Or, if you have the GO toolkit installed, just install it like this:
```shell ```shell
go install github.com/tlinden/anydb@latest go install codeberg.org/scip/anydb@latest
``` ```
If you do not find a binary release for your platform, please don't If you do not find a binary release for your platform, please don't
@@ -105,14 +104,14 @@ Here, we operate in a local directory `mydb`, which we'll use as HOME
inside the docker container. anydb will store its database in inside the docker container. anydb will store its database in
`mydb/.config/anydb/default.db`. `mydb/.config/anydb/default.db`.
A list of available images is [here](https://github.com/tlinden/anydb/pkgs/container/anydb/versions?filters%5Bversion_type%5D=tagged) A list of available images is [here](https://codeberg.org/scip/anydb/pkgs/container/anydb/versions?filters%5Bversion_type%5D=tagged)
## Documentation ## Documentation
The documentation is provided as a unix man-page. It will be The documentation is provided as a unix man-page. It will be
automatically installed if you install from source. However, you can automatically installed if you install from source. However, you can
[read the man-page online](https://github.com/TLINDEN/anydb/blob/master/anydb.pod) [read the man-page online](https://codeberg.org/scip/anydb/blob/master/anydb.pod)
Or if you cloned the repository you can read it this way (perl needs Or if you cloned the repository you can read it this way (perl needs
to be installed though): `perldoc anydb.pod`. to be installed though): `perldoc anydb.pod`.
@@ -129,7 +128,7 @@ best way for me to forget to do something.
In order to report a bug, unexpected behavior, feature requests or to In order to report a bug, unexpected behavior, feature requests or to
submit a patch, please open an issue on github: submit a patch, please open an issue on github:
https://github.com/TLINDEN/anydb/issues. https://codeberg.org/scip/anydb/issues.
## Copyright and license ## Copyright and license
@@ -141,7 +140,7 @@ T.v.Dein <tom AT vondein DOT org>
## Project homepage ## Project homepage
https://github.com/TLINDEN/anydb https://codeberg.org/scip/anydb
## Copyright and License ## Copyright and License

View File

@@ -746,7 +746,7 @@ List all keys:
.IX Header "BUGS" .IX Header "BUGS"
In order to report a bug, unexpected behavior, feature requests In order to report a bug, unexpected behavior, feature requests
or to submit a patch, please open an issue on github: or to submit a patch, please open an issue on github:
<https://github.com/TLINDEN/anydb/issues>. <https://codeberg.org/scip/anydb/issues>.
.PP .PP
Please repeat the failing command with debugging enabled \f(CW\*(C`\-d\*(C'\fR and Please repeat the failing command with debugging enabled \f(CW\*(C`\-d\*(C'\fR and
include the output in the issue. include the output in the issue.

View File

@@ -583,7 +583,7 @@ List all keys:
In order to report a bug, unexpected behavior, feature requests In order to report a bug, unexpected behavior, feature requests
or to submit a patch, please open an issue on github: or to submit a patch, please open an issue on github:
L<https://github.com/TLINDEN/anydb/issues>. L<https://codeberg.org/scip/anydb/issues>.
Please repeat the failing command with debugging enabled C<-d> and Please repeat the failing command with debugging enabled C<-d> and
include the output in the issue. include the output in the issue.

View File

@@ -28,7 +28,7 @@ import (
"strings" "strings"
"time" "time"
common "github.com/tlinden/anydb/common" common "codeberg.org/scip/anydb/common"
bolt "go.etcd.io/bbolt" bolt "go.etcd.io/bbolt"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"

View File

@@ -5,7 +5,7 @@ package app;
import "google/protobuf/timestamp.proto"; import "google/protobuf/timestamp.proto";
option go_package = "github.com/tlinden/anydb/app"; option go_package = "codeberg.org/scip/anydb/app";
message DbEntry { message DbEntry {
string Id = 1; string Id = 1;

View File

@@ -22,8 +22,8 @@ import (
"os" "os"
"github.com/pelletier/go-toml" "github.com/pelletier/go-toml"
"github.com/tlinden/anydb/app" "codeberg.org/scip/anydb/app"
"github.com/tlinden/anydb/common" "codeberg.org/scip/anydb/common"
) )
var Version string = "v0.2.6" var Version string = "v0.2.6"

View File

@@ -517,7 +517,7 @@ REST API
BUGS BUGS
In order to report a bug, unexpected behavior, feature requests or to In order to report a bug, unexpected behavior, feature requests or to
submit a patch, please open an issue on github: submit a patch, please open an issue on github:
<https://github.com/TLINDEN/anydb/issues>. <https://codeberg.org/scip/anydb/issues>.
Please repeat the failing command with debugging enabled "-d" and Please repeat the failing command with debugging enabled "-d" and
include the output in the issue. include the output in the issue.

View File

@@ -22,9 +22,9 @@ import (
"strings" "strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/tlinden/anydb/app" "codeberg.org/scip/anydb/app"
"github.com/tlinden/anydb/cfg" "codeberg.org/scip/anydb/cfg"
"github.com/tlinden/anydb/output" "codeberg.org/scip/anydb/output"
) )
func Set(conf *cfg.Config) *cobra.Command { func Set(conf *cfg.Config) *cobra.Command {

View File

@@ -26,10 +26,10 @@ import (
"os/exec" "os/exec"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/tlinden/anydb/app" "codeberg.org/scip/anydb/app"
"github.com/tlinden/anydb/cfg" "codeberg.org/scip/anydb/cfg"
"github.com/tlinden/anydb/output" "codeberg.org/scip/anydb/output"
"github.com/tlinden/anydb/rest" "codeberg.org/scip/anydb/rest"
) )
func Export(conf *cfg.Config) *cobra.Command { func Export(conf *cfg.Config) *cobra.Command {

View File

@@ -25,8 +25,8 @@ import (
"runtime/debug" "runtime/debug"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/tlinden/anydb/app" "codeberg.org/scip/anydb/app"
"github.com/tlinden/anydb/cfg" "codeberg.org/scip/anydb/cfg"
"github.com/tlinden/yadu" "github.com/tlinden/yadu"
) )

View File

@@ -177,6 +177,6 @@ Enter
Sleep 3s Sleep 3s
Enter Enter
Type "# Try it out yourself: github.com/tlinden/anydb!" Type "# Try it out yourself: codeberg.org/scip/anydb!"
Enter Enter
Sleep 4s Sleep 4s

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/tlinden/anydb module codeberg.org/scip/anydb
go 1.24.0 go 1.24.0

View File

@@ -24,7 +24,7 @@ import (
"runtime" "runtime"
"github.com/inconshreveable/mousetrap" "github.com/inconshreveable/mousetrap"
"github.com/tlinden/anydb/cmd" "codeberg.org/scip/anydb/cmd"
) )
func main() { func main() {

View File

@@ -21,8 +21,8 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/tlinden/anydb/app" "codeberg.org/scip/anydb/app"
"github.com/tlinden/anydb/cfg" "codeberg.org/scip/anydb/cfg"
) )
func WriteJSON(attr *app.DbAttr, conf *cfg.Config, entries app.DbEntries) error { func WriteJSON(attr *app.DbAttr, conf *cfg.Config, entries app.DbEntries) error {

View File

@@ -30,8 +30,8 @@ import (
"github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter"
"github.com/olekukonko/tablewriter/renderer" "github.com/olekukonko/tablewriter/renderer"
"github.com/olekukonko/tablewriter/tw" "github.com/olekukonko/tablewriter/tw"
"github.com/tlinden/anydb/app" "codeberg.org/scip/anydb/app"
"github.com/tlinden/anydb/cfg" "codeberg.org/scip/anydb/cfg"
) )
func List(writer io.Writer, conf *cfg.Config, entries app.DbEntries) error { func List(writer io.Writer, conf *cfg.Config, entries app.DbEntries) error {

View File

@@ -25,8 +25,8 @@ import (
"reflect" "reflect"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
"github.com/tlinden/anydb/app" "codeberg.org/scip/anydb/app"
"github.com/tlinden/anydb/cfg" "codeberg.org/scip/anydb/cfg"
"golang.org/x/term" "golang.org/x/term"
//"github.com/alecthomas/repr" //"github.com/alecthomas/repr"
) )

View File

@@ -20,8 +20,8 @@ import (
//"github.com/alecthomas/repr" //"github.com/alecthomas/repr"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/tlinden/anydb/app" "codeberg.org/scip/anydb/app"
"github.com/tlinden/anydb/cfg" "codeberg.org/scip/anydb/cfg"
) )
type SetContext struct { type SetContext struct {

View File

@@ -21,7 +21,7 @@ import (
"github.com/gofiber/fiber/v2/middleware/compress" "github.com/gofiber/fiber/v2/middleware/compress"
"github.com/gofiber/fiber/v2/middleware/cors" "github.com/gofiber/fiber/v2/middleware/cors"
"github.com/gofiber/fiber/v2/middleware/logger" "github.com/gofiber/fiber/v2/middleware/logger"
"github.com/tlinden/anydb/cfg" "codeberg.org/scip/anydb/cfg"
) )
// used to return to the api client // used to return to the api client