bitch-cli/templates/workflows/ci-publish-separate.yml

73 lines
1.5 KiB
YAML
Raw Normal View History

# Forgejo Actions workflow with separate CI and publish jobs
# For high-impact packages that need thorough validation
name: CI and Publish
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint || true
- name: Type check
run: pnpm typecheck || true
- name: Build
run: pnpm build
- name: Test
run: pnpm test || true
publish:
needs: ci
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'http://forge.black.lan/api/packages/lilith/npm/'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks