Fix Gitea release creation: include created_at timestamp to work around Gitea bug where releases get epoch zero timestamp

This commit is contained in:
Laan Tungir
2026-07-16 16:10:00 -04:00
parent 5744b83288
commit 09f3ec2f7c
2 changed files with 10 additions and 3 deletions

View File

@@ -219,15 +219,22 @@ create_gitea_release() {
token=$(cat "$HOME/.gitea_token" | tr -d '\n\r') token=$(cat "$HOME/.gitea_token" | tr -d '\n\r')
local api_url="https://git.laantungir.net/api/v1/repos/laantungir/n_signer" 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 local response
response=$(curl -s -X POST "$api_url/releases" \ response=$(curl -s -X POST "$api_url/releases" \
-H "Authorization: token $token" \ -H "Authorization: token $token" \
-H "Content-Type: application/json" \ -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 if echo "$response" | grep -q '"id"'; then
echo "$response" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2 echo "$response" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2
else else
print_error "Failed to create Gitea release: $response"
return 1 return 1
fi fi
} }

View File

@@ -757,8 +757,8 @@ int socket_name_random(char *out, size_t out_len);
/* Version information (auto-updated by build/version tooling) */ /* Version information (auto-updated by build/version tooling) */
#define NSIGNER_VERSION_MAJOR 0 #define NSIGNER_VERSION_MAJOR 0
#define NSIGNER_VERSION_MINOR 0 #define NSIGNER_VERSION_MINOR 0
#define NSIGNER_VERSION_PATCH 47 #define NSIGNER_VERSION_PATCH 45
#define NSIGNER_VERSION "v0.0.47" #define NSIGNER_VERSION "v0.0.45"
/* NSIGNER_HEADERLESS_DECLS_END */ /* NSIGNER_HEADERLESS_DECLS_END */