diff --git a/increment_and_push.sh b/increment_and_push.sh index fe5374d..839f1ae 100755 --- a/increment_and_push.sh +++ b/increment_and_push.sh @@ -219,15 +219,22 @@ create_gitea_release() { token=$(cat "$HOME/.gitea_token" | tr -d '\n\r') local api_url="https://git.laantungir.net/api/v1/repos/laantungir/n_signer" + # Include created_at timestamp to work around Gitea bug where releases + # created without a timestamp get epoch zero and don't appear in the + # releases list or web UI. + local now_iso + now_iso=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + local response response=$(curl -s -X POST "$api_url/releases" \ -H "Authorization: token $token" \ -H "Content-Type: application/json" \ - -d "{\"tag_name\": \"$NEW_VERSION\", \"name\": \"$NEW_VERSION\", \"body\": \"$COMMIT_MESSAGE\"}") + -d "{\"tag_name\": \"$NEW_VERSION\", \"target_commitish\": \"master\", \"name\": \"$NEW_VERSION\", \"body\": \"$COMMIT_MESSAGE\", \"draft\": false, \"prerelease\": false, \"created_at\": \"$now_iso\"}") if echo "$response" | grep -q '"id"'; then echo "$response" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2 else + print_error "Failed to create Gitea release: $response" return 1 fi } diff --git a/src/main.c b/src/main.c index ccae2a5..823360a 100644 --- a/src/main.c +++ b/src/main.c @@ -757,8 +757,8 @@ int socket_name_random(char *out, size_t out_len); /* Version information (auto-updated by build/version tooling) */ #define NSIGNER_VERSION_MAJOR 0 #define NSIGNER_VERSION_MINOR 0 -#define NSIGNER_VERSION_PATCH 47 -#define NSIGNER_VERSION "v0.0.47" +#define NSIGNER_VERSION_PATCH 45 +#define NSIGNER_VERSION "v0.0.45" /* NSIGNER_HEADERLESS_DECLS_END */