Load gitea token from .env.local
This commit is contained in:
parent
0922a98eb6
commit
4fc3c02ced
2 changed files with 8 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue