Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

permissions:
contents: read
id-token: write

env:
CURL_VERSION: 8.19.0
Expand Down Expand Up @@ -257,3 +258,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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading