From d4157f074eb223e715f083974638ed352282a9f2 Mon Sep 17 00:00:00 2001 From: Soccera1 <129828376+Soccera1@users.noreply.github.com> Date: Fri, 1 May 2026 17:31:27 +1000 Subject: [PATCH 1/2] Add npm publish workflow --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ README.md | 6 ++--- package.json | 2 +- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b93b1f..893f12b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + id-token: write env: CURL_VERSION: 8.19.0 @@ -253,3 +254,47 @@ jobs: release/tweeta-darwin-x64 \ release/tweeta-darwin-arm64 fi + + publish-npm: + needs: + - metadata + - release + if: github.ref_name == github.event.repository.default_branch + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "24" + registry-url: https://registry.npmjs.org + + - name: Download release artifacts + uses: actions/download-artifact@v4 + with: + path: dist + + - name: Prepare npm package + env: + VERSION: ${{ needs.metadata.outputs.version }} + run: | + set -eu + rm -rf npm-binaries + mkdir -p npm-binaries + find dist -type f -name 'tweeta-*' -exec cp {} npm-binaries/ \; + for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64; do + test -f "npm-binaries/tweeta-${target}" + done + chmod 755 npm-binaries/tweeta-* + npm version --no-git-tag-version "${VERSION}" + npm pack --dry-run + + - name: Publish npm package + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --provenance diff --git a/README.md b/README.md index 7e6331e..3b04661 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# tweeta-cli +# tweetapus `tweeta` is a C/libcurl command-line client for Tweetapus, designed for AI agents and automation. @@ -17,12 +17,12 @@ make Install from npm once published: ```sh -npm install -g tweeta-cli +npm install -g tweetapus ``` The npm package contains prebuilt static `tweeta` binaries, so installation on the end user's machine does not compile anything and does not fetch additional artifacts. -The package is not published yet. The npm packaging in this repository is there so it can be published later from CI. +The package is published from CI after a successful default-branch release. When the package is published, it is intended to be assembled before publish by downloading release assets from `https://github.com/tweetapus/tweeta-cli/releases/latest`. It expects assets named: diff --git a/package.json b/package.json index ebb0733..295921b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "tweeta-cli", + "name": "tweetapus", "version": "0.1.0", "description": "CLI wrapper for the Tweetapus tweeta client", "license": "AGPL-3.0-or-later", From adfbff09e562aa7793b0a5d6f4e003e5de756404 Mon Sep 17 00:00:00 2001 From: Soccera1 <129828376+Soccera1@users.noreply.github.com> Date: Fri, 1 May 2026 17:57:44 +1000 Subject: [PATCH 2/2] Fix name on README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b04661..daade70 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# tweetapus +# tweeta-cli `tweeta` is a C/libcurl command-line client for Tweetapus, designed for AI agents and automation.