diff --git a/.github/workflows/ci.yml b/.gitea/workflows/ci.yml similarity index 93% rename from .github/workflows/ci.yml rename to .gitea/workflows/ci.yml index ce30715..0c0e105 100644 --- a/.github/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -29,7 +29,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - cache: 'pnpm' + cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.gitea/workflows/publish-npm.yml b/.gitea/workflows/publish-npm.yml new file mode 100644 index 0000000..45063fb --- /dev/null +++ b/.gitea/workflows/publish-npm.yml @@ -0,0 +1,43 @@ +name: Publish npm package + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-24.04 + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build package + run: pnpm run build:dist + + - name: Publish to Gitea Packages + run: | + npm config set @yuta:registry "$GITEA_NPM_REGISTRY" + npm config set "${GITEA_NPM_REGISTRY#https:}:_authToken" "$NODE_AUTH_TOKEN" + npm publish --access public + env: + GITEA_NPM_REGISTRY: ${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/npm/ + NODE_AUTH_TOKEN: ${{ secrets.GITEA_TOKEN }} diff --git a/README.md b/README.md index 23c40e6..9bac043 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,27 @@ query IDs, and anti-bot behavior at any time — **expect this to break without ## Install ```bash -npm install -g @steipete/bird +npm install -g @yuta/bird # or -pnpm add -g @steipete/bird +pnpm add -g @yuta/bird # or -bun add -g @steipete/bird +bun add -g @yuta/bird # one-shot (no install) -bunx @steipete/bird whoami +bunx @yuta/bird whoami +``` + +Gitea Packages: + +```bash +npm config set @yuta:registry=https://git.yutakobayashi.com/api/packages/yuta/npm/ +npm install -g @yuta/bird +``` + +Nix flakes: + +```bash +nix run git+https://git.yutakobayashi.com/yuta/bird -- --help ``` Homebrew (macOS, prebuilt Bun binary): @@ -130,7 +143,7 @@ By default, the command fetches from For You, News, Sports, and Entertainment ta `bird` can be used as a library (same GraphQL client as the CLI): ```ts -import { TwitterClient } from '@steipete/bird'; +import { TwitterClient } from '@yuta/bird'; const client = new TwitterClient({ relayBaseUrl: process.env.TWITTER_RELAY_BASE_URL @@ -334,6 +347,8 @@ pnpm install pnpm run build # dist/ + bun binary pnpm run build:dist # dist/ only pnpm run build:binary +nix build .#bird +nix run .# -- --help pnpm run dev tweet "Test" pnpm run dev -- --plain check diff --git a/docs/404.html b/docs/404.html index 390d4e9..e4fddf3 100644 --- a/docs/404.html +++ b/docs/404.html @@ -35,9 +35,8 @@
That path doesn’t exist. The CLI does.