Fork of upstream llblab/[email protected].0 (SHA afe09c5) repackaged as a drop-in extension for can1357/oh-my-pi (omp >= 16.5.2). Changes vs upstream: - Rename package: @llblab/pi-telegram -> @evandrodevbr/oh-my-pi-telegram - Bump version: 0.22.0 -> 0.22.0-evandro.1 - Update repository/homepage/bugs URLs to evandrodevbr - Add omp field in package.json (displayName + compatibleWith) - README: prepend 'Oh My Pi (omp) Compatibility' section with install commands, verified-components table, upstream lineage, and rationale - CHANGELOG: add '0.22.0-evandro.1' entry under Unreleased - docs/: rename @llblab/pi-telegram imports to @evandrodevbr/oh-my-pi-telegram - tests/public-api.test.ts: rename package import paths Gates re-run on the fork: - npm run typecheck -> tsc --noEmit (success) - npm test -> 1229 pass / 0 fail / 1 platform-only skip - npm run audit -> found 0 vulnerabilities - npm run pack:check -> evandrodevbr-oh-my-pi-telegram-0.22.0-evandro.1.tgz Verified: - omp install --link ./pi-telegram -> Linked OK - omp plugin list -> @evandrodevbr/[email protected].0-evandro.1 Upstream lineage: badlogic/pi-telegram -> llblab/pi-telegram (0.22.0) -> evandrodevbr/oh-my-pi-telegram (this fork)
52 lines
1.9 KiB
YAML
52 lines
1.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Build release notes from changelog
|
|
env:
|
|
TAG_NAME: ${{ github.ref_name }}
|
|
run: |
|
|
node --input-type=module <<'NODE'
|
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
const tagName = process.env.TAG_NAME;
|
|
const version = tagName?.replace(/^v/, "");
|
|
if (!version) throw new Error("Missing release tag name.");
|
|
const packageJson = JSON.parse(readFileSync("package.json", "utf8"));
|
|
if (packageJson.version !== version) {
|
|
throw new Error(`Tag ${tagName} does not match package.json version ${packageJson.version}.`);
|
|
}
|
|
const changelog = readFileSync("CHANGELOG.md", "utf8");
|
|
const escapedVersion = version.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
const pattern = new RegExp(`^##\\s+(${escapedVersion}(?:[^\\n]*)?)\\n([\\s\\S]*?)(?=^##\\s+|(?![\\s\\S]))`, "m");
|
|
const match = changelog.match(pattern);
|
|
if (!match) throw new Error(`CHANGELOG.md has no section for ${version}.`);
|
|
const title = match[1].trim();
|
|
const notes = match[2].trim();
|
|
if (!notes) throw new Error(`CHANGELOG.md section for ${version} is empty.`);
|
|
writeFileSync("release-title.txt", `${title}\n`);
|
|
writeFileSync("release-notes.md", `${notes}\n`);
|
|
NODE
|
|
- name: Publish GitHub release
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
TAG_NAME: ${{ github.ref_name }}
|
|
run: |
|
|
gh release create "$TAG_NAME" \
|
|
--title "$(cat release-title.txt)" \
|
|
--notes-file release-notes.md \
|
|
--verify-tag
|