46 lines
1023 B
YAML
46 lines
1023 B
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- '*.*.*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 26
|
|
registry-url: ${{ secrets.CI_URL }}/api/packages/${{ secrets.CI_OWNER }}/npm/
|
|
scope: '@koszewscy'
|
|
|
|
- name: Install
|
|
run: npm ci --no-fund
|
|
|
|
- name: Check
|
|
run: |
|
|
npm run typecheck
|
|
npm run lint
|
|
|
|
- name: Build package
|
|
run: npm run build
|
|
|
|
- name: Publish package
|
|
working-directory: dist
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.CI_TOKEN }}
|
|
run: |
|
|
package="$(node -p 'const p = require("./package.json"); `${p.name}@${p.version}`')"
|
|
if npm view "$package" version >/dev/null 2>&1; then
|
|
echo "$package is already published, skipping."
|
|
exit 0
|
|
fi
|
|
npm publish
|