You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
1.0 KiB

name: publish
on:
push:
tags: ['core-v*', 'humanoid-v*']
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://<gitea-host>/api/packages/<owner>/npm/
scope: '@webavatar'
- run: npm ci
- run: npm run build:packages
- name: Resolve the workspace from the tag and check its version
run: |
case "$GITHUB_REF_NAME" in
core-v*) WS=packages/core; VERSION="${GITHUB_REF_NAME#core-v}" ;;
humanoid-v*) WS=packages/humanoid; VERSION="${GITHUB_REF_NAME#humanoid-v}" ;;
*) echo "unexpected tag $GITHUB_REF_NAME"; exit 1 ;;
esac
test "$(node -p "require('./$WS/package.json').version")" = "$VERSION"
echo "WS=$WS" >> "$GITHUB_ENV"
- run: npm test -w "$WS"
- run: npm publish -w "$WS"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}