From 4fc3c02cedd2a6c0120a3d0af4e8182e5cb4b6d4 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 17 Sep 2026 16:36:31 -0700 Subject: [PATCH] Load gitea token from .env.local --- README.md | 6 ++++-- scripts/publish-android-release.mjs | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d1b28b90..fced0ce1 100644 --- a/README.md +++ b/README.md @@ -160,11 +160,13 @@ Signed APKs are attached to releases on the [releases page](https://gitea.coracle.social/coracle/flotilla/releases), so Android users can install and update outside an app store. -Bump the version, write its `CHANGELOG.md` section and push the matching tag, then: +Publishing needs `GITEA_TOKEN` in `.env.local`, set to a gitea access token with `write:repository` +(Settings → Applications → Access Tokens). Bump the version, write its `CHANGELOG.md` section and +push the matching tag, then: ```sh pnpm run release:android -GITEA_TOKEN=... pnpm run publish:android +pnpm run publish:android ``` `publish:android` creates the release for the tag, takes its notes from the changelog, and attaches diff --git a/scripts/publish-android-release.mjs b/scripts/publish-android-release.mjs index 43e85d53..79ffa851 100644 --- a/scripts/publish-android-release.mjs +++ b/scripts/publish-android-release.mjs @@ -1,8 +1,11 @@ #!/usr/bin/env node import {readFile} from "node:fs/promises" +import {config} from "dotenv" const read = path => readFile(new URL(path, import.meta.url), "utf-8") +config({path: new URL("../.env.local", import.meta.url)}) + const token = process.env.GITEA_TOKEN const {name, version} = JSON.parse(await read("../package.json")) const changelog = await read("../CHANGELOG.md") @@ -44,7 +47,7 @@ const api = async (method, path, {body, allow404} = {}) => { } if (!token) { - throw new Error("Set GITEA_TOKEN to a token with write access to the repository") + throw new Error("Set GITEA_TOKEN in .env.local to a token with write access to the repository") } const lines = changelog.split("\n")