From 4882d8821e359460a32d832004e7f94910af2f07 Mon Sep 17 00:00:00 2001 From: Lantanios Date: Thu, 29 Jan 2026 11:52:57 -0500 Subject: [PATCH] ci: add GitHub Actions workflow for npm publish --- .github/workflows/publish.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..ad6c9b034 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,46 @@ +name: Publish to npm + +on: + push: + branches: + - lantanios + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + registry-url: 'https://registry.npmjs.org' + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + + - name: Update package name for scoped publish + run: | + node -e " + const fs = require('fs'); + const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); + pkg.name = '@lantanios/moltbot'; + fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)); + " + + - name: Publish to npm + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}