From 2036b4b65ff46e3d6bb5d8fb5228fe156398c836 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Sat, 6 Dec 2025 20:45:38 +0100 Subject: [PATCH] moving to codeberg --- .github/workflows/ci.yaml | 47 ---------------------------- .goreleaser.yaml | 65 +++++++++++++++++++++++++++++++++++++++ .woodpecker/build.yaml | 36 ++++++++++++++++++++++ .woodpecker/release.yaml | 15 +++++++++ Makefile.dist | 18 +++++++++++ handler.go | 2 +- 6 files changed, 135 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/ci.yaml create mode 100644 .goreleaser.yaml create mode 100644 .woodpecker/build.yaml create mode 100644 .woodpecker/release.yaml create mode 100644 Makefile.dist diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 9172556..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: build-and-test -on: [push, pull_request] -jobs: - build: - strategy: - matrix: - version: [1.21] - os: [ubuntu-latest, windows-latest, macos-latest] - name: Build - runs-on: ${{ matrix.os }} - steps: - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.version }} - id: go - - - name: checkout - uses: actions/checkout@v3 - - - 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@v3 - with: - go-version: 1.21 - - uses: actions/checkout@v3 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..3dcb5ac --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,65 @@ +# 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 + - 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: 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/yadu/compare/{{ .PreviousTag }}...{{ .Tag }}) diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..e20cc6f --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,36 @@ +matrix: + platform: + - linux/amd64 + goversion: + - 1.24 + +labels: + platform: ${platform} + +steps: + build: + when: + event: [push] + image: golang:${goversion} + commands: + - go get + - go build + + 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 ./... + depends_on: [build] + + test: + when: + event: [push] + image: golang:${goversion} + commands: + - go get + - go test -v -cover + depends_on: [build,linter] diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml new file mode 100644 index 0000000..916c008 --- /dev/null +++ b/.woodpecker/release.yaml @@ -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 diff --git a/Makefile.dist b/Makefile.dist new file mode 100644 index 0000000..55d2f38 --- /dev/null +++ b/Makefile.dist @@ -0,0 +1,18 @@ +# -*-make-*- + +.PHONY: install all + +tool = rpn +PREFIX = /usr/local +UID = root +GID = 0 + +all: + @echo "Type 'sudo make install' to install the tool." + @echo "To change prefix, type 'sudo make install PREFIX=/opt'" + +install: + install -d -o $(UID) -g $(GID) $(PREFIX)/bin + install -d -o $(UID) -g $(GID) $(PREFIX)/share/doc + install -o $(UID) -g $(GID) -m 555 $(tool) $(PREFIX)/sbin/ + install -o $(UID) -g $(GID) -m 444 *.md $(PREFIX)/share/doc/ diff --git a/handler.go b/handler.go index 4830ff1..9533613 100644 --- a/handler.go +++ b/handler.go @@ -42,7 +42,7 @@ type Handler struct { /* This is being used in Postprocess() to fix https://github.com/go-yaml/yaml/issues/1020 and - https://github.com/TLINDEN/yadu/issues/12 respectively. + https://github.com/tlinden/yadu/issues/12 respectively. yaml.v3 follows the YAML standard and quotes all keys and values matching this regex (see https://yaml.org/type/bool.html):