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
57 changes: 57 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Publish npm

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: Existing release tag to publish, e.g. v0.6.3
required: true

permissions:
contents: read
id-token: write

concurrency:
group: publish-npm

jobs:
publish:
runs-on: ubuntu-latest
env:
TAG: ${{ github.event.release.tag_name || inputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.10
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: https://registry.npmjs.org
# Trusted publishing and `npm stage` need a recent npm.
- name: Update npm
run: npm install -g npm@latest
- name: Download release binaries.json
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
mkdir -p packages/cli/dist/bin
gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern binaries.json --dir packages/cli/dist/bin
version="${TAG#v}"
test "$(jq -r .version packages/cli/package.json)" = "$version"
test "$(jq -r .version packages/cli/dist/bin/binaries.json)" = "$version"
test "$(jq '.artifacts | length' packages/cli/dist/bin/binaries.json)" -eq 4
- name: Build npm package
working-directory: packages/npm
run: bun run build
# Stage only: a maintainer approves the version on npmjs.com (Staged Packages) before it goes live.
- name: Stage publish
working-directory: packages/npm
run: npm stage publish
5 changes: 5 additions & 0 deletions packages/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"version": "0.6.3",
"description": "Beeper CLI binary launcher",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/beeper/cli.git",
"directory": "packages/npm"
},
"type": "module",
"bin": {
"beeper": "bin/beeper.js"
Expand Down
Loading