Skip to content

fix: configure .npmrc with NPM_TOKEN #32

fix: configure .npmrc with NPM_TOKEN

fix: configure .npmrc with NPM_TOKEN #32

Workflow file for this run

name: Release
on:
push:
branches:
- main
- beta
- alpha
workflow_dispatch:
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: |
github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/alpha') ||
github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run tests
run: bun run test
- name: Run type checking
run: bun run typecheck
- name: Build package
run: bun run build
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Configure .npmrc
run: |
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> ~/.npmrc
- name: Sampo Release & Publish
id: sampo
uses: bruits/sampo/crates/sampo-github-action@main
with:
command: auto
create-github-release: true
args: --access public --ignore-scripts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}