-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 971 Bytes
/
npm-publish.yaml
File metadata and controls
35 lines (32 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Publish packages to NPM (npmjs.com)
on:
push:
branches:
- main
permissions:
contents: read
id-token: write # Required for npmjs OIDC
jobs:
publish-npm:
name: Publish
strategy:
matrix:
project: [devbcn-2025-mcp-server]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 'latest'
- name: Publish
working-directory: ./${{ matrix.project }}
run: |
sed -i "s/\"version\": \".*\"/\"version\": \"0.0.0-$(date +%Y%m%d%H%M)\"/" package.json
bun install
bun run build
echo '#!/usr/bin/env node' | cat - dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js
chmod +x dist/index.js
bun install -g npm@latest # Latest npm version is required for OIDC support
npm publish --tag latest