when: - event: [push, pull_request, manual] variables: - &node_image "node:22-alpine" steps: install: image: *node_image commands: - corepack enable - npm ci lint: image: *node_image commands: - npm run lint depends_on: - install typecheck: image: *node_image commands: - npm run typecheck depends_on: - install format-check: image: *node_image commands: - npm run format:check depends_on: - install security-audit: image: *node_image commands: - npm audit --audit-level=high depends_on: - install test: image: *node_image commands: - npm run test:coverage depends_on: - install build: image: *node_image commands: - npm run build depends_on: - lint - typecheck - format-check - security-audit - test publish: image: *node_image environment: GITEA_TOKEN: from_secret: gitea_token commands: - npm run build - | echo "//git.mosaicstack.dev/api/packages/mosaic/npm/:_authToken=$$GITEA_TOKEN" > .npmrc echo "@mosaicstack:registry=https://git.mosaicstack.dev/api/packages/mosaic/npm/" >> .npmrc - | CURRENT=$(node -p "require('./package.json').version") PUBLISHED=$(npm view @mosaicstack/telemetry-client version 2>/dev/null || echo "0.0.0") if [ "$$CURRENT" = "$$PUBLISHED" ]; then echo "Version $$CURRENT already published, skipping" exit 0 fi echo "Publishing $$CURRENT (was $$PUBLISHED)" npm publish --access public when: - branch: [main, develop] event: [push, manual, tag] depends_on: - build