Skip to content
Merged
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
49 changes: 49 additions & 0 deletions .github/workflows/first-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: First publish

# One-off: publishes the packages that have never been on npm (cli, ingest and
# the stores), from the v0.8 release commit, with the NPM_TOKEN secret. Once
# they exist, trusted publishing can be turned on for them and this workflow
# is removed.
on:
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: b456c36a86183f5e2e87129ac538632fd0c2a618

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: https://registry.npmjs.org

- run: pnpm install --frozen-lockfile

- name: Build
run: pnpm --filter "./packages/*" build

- name: Publish the packages that aren't on npm yet
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: 'true'
run: |
for p in ingest cli store-cloudflare store-postgres store-redis store-sqlite store-upstash-vector; do
v=$(node -p "require('./packages/$p/package.json').version")
if npm view "@chatcops/$p@$v" version >/dev/null 2>&1; then
echo "@chatcops/$p@$v is already on npm"
continue
fi
# They're private on that commit, which pnpm publish refuses.
node -e "const f='packages/$p/package.json',fs=require('fs'),j=JSON.parse(fs.readFileSync(f));delete j.private;fs.writeFileSync(f,JSON.stringify(j,null,2)+'\n')"
(cd "packages/$p" && pnpm publish --access public --no-git-checks)
done
Loading