diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..29b80ea --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,17 @@ +matrix: + platform: + - linux/amd64 + +labels: + platform: ${platform} + +steps: + build-n-test: + when: + event: [push] + image: alpine:latest + commands: + - apk update + - apk add --no-cache bash build-base words-en gdb perl autoconf automake pcre2 + - ./autogen.sh + diff --git a/.woodpecker/release.sh b/.woodpecker/release.sh new file mode 100755 index 0000000..1081660 --- /dev/null +++ b/.woodpecker/release.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# This is my own simple codeberg generic releaser. It takes to +# binaries to be uploaded as arguments and takes every other args from +# env. Works on tags or normal commits (push), tags must start with v. + + +set -e + +die() { + echo $* + exit 1 +} + +if test -z "$DEPLOY_TOKEN"; then + die "token DEPLOY_TOKEN not set" +fi + +git fetch --all + +# determine current tag or commit hash +version="$CI_COMMIT_TAG" +previous="" +log="" +if test -z "$version"; then + version="${CI_COMMIT_SHA:0:6}" + log=$(git log -1 --oneline) +else + previous=$(git tag -l | grep -E "^v" | tac | grep -A1 "$version" | tail -1) + log=$(git log -1 --oneline "${previous}..${version}" | sed 's|^|- |g') +fi + +# release body +printf "# Changes\n\n %s\n" "$log" > body.txt + +# create the release +https --ignore-stdin --check-status -b -A bearer -a "$DEPLOY_TOKEN" POST \ + "https://codeberg.org/api/v1/repos/${CI_REPO_OWNER}/${CI_REPO_NAME}/releases" \ + tag_name="$version" name="Release $version" body=@body.txt > release.json + +# we need the id to upload files +ID=$(jq -r .id < release.json) + +if test -z "$ID"; then + cat release.json + die "failed to create release" +fi + +# actually upload +for file in "$@"; do + https --ignore-stdin --check-status -A bearer -a "$DEPLOY_TOKEN" -f POST \ + "https://codeberg.org/api/v1/repos/${CI_REPO_OWNER}/${CI_REPO_NAME}/releases/$ID/assets" \ + "name=${file}-${version}" "attachment@${file}" +done diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml new file mode 100644 index 0000000..990eea8 --- /dev/null +++ b/.woodpecker/release.yaml @@ -0,0 +1,28 @@ +# build release + +labels: + platform: linux/amd64 + +steps: + compile: + when: + event: [manual] + image: alpine:latest + commands: + - apk update + - apk add --no-cache bash build-base + - make static + - file dicepwgen_static + - mv dicepwgen_static dicepwgen-linux-amd64 + + release: + image: alpine:latest + when: + event: [manual] + environment: + DEPLOY_TOKEN: + from_secret: DEPLOY_TOKEN + commands: + - apk update + - apk add --no-cache bash httpie jq git + - .woodpecker/release.sh dicepwgen-linux-amd64 diff --git a/README b/README index 0e0f88c..0bb26e9 100644 --- a/README +++ b/README @@ -20,9 +20,12 @@ And the berkeley library at: http://www.sleepycat.com. -Installation +Installation from source ============================================================ +If you build directly from the git repo, you'll need to generate the +configure script first with 'autogen.sh'. + For installation run: % ./configure diff --git a/dbtool.pod b/dbtool.pod index 4a6ee3b..ad8353f 100644 --- a/dbtool.pod +++ b/dbtool.pod @@ -139,7 +139,7 @@ or the parameter of B<-F>. =head1 EXPRESSIONS Regular expressions are provided using the B. It supports most of -the features which perl provides. See the section »DIFFERENCES FROM PERL« in the PCRE +the features which perl provides. See the section "DIFFERENCES FROM PERL" in the PCRE manpage. You can also take a look to the perl regular expression man page with the following command: @@ -247,7 +247,7 @@ and it's attributes. =head1 REPORTING BUGS -Report bugs on L or mail to . +Report bugs on L or mail to . =head1 COPYRIGHT