mirror of
https://github.com/NocturnLabs/opencode-personal-knowledge.git
synced 2026-07-18 08:05:59 +02:00
4e5912fa28
This commit enhances the npm publish workflow to include automated version bumping and updates necessary permissions and configurations. Changes: - Added contents: write permission to allow pushing version bump commits - Configured git user for automated commits - Added npm version patch step to automatically increment patch version - Added commit and push steps for version changes - Updated version numbers in package.json and src/index.ts - Added token configuration for checkout step for enhanced security
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Publish to npm
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "src/**"
|
|
|
|
permissions:
|
|
id-token: write # Required for OIDC
|
|
contents: write # Required to push version bump commit
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Ensure latest npm
|
|
run: npm install -g npm@latest
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- name: Bump version
|
|
run: npm version patch --no-git-tag-version
|
|
|
|
- name: Commit version bump
|
|
run: |
|
|
git add package.json
|
|
git commit -m "chore: bump version to $(node -p "require('./package.json').version")" || echo "No changes to commit"
|
|
git push
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Build
|
|
run: bun run build
|
|
|
|
- name: Publish
|
|
run: npm publish --access public |