Files
smpp-js/.gitea/workflows/release.yaml
T

36 lines
891 B
YAML

name: Release
on:
push:
tags: ['v[0-9]+.[0-9]+.[0-9]+']
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@v7.0.0
with:
cache: npm
node-version: 24.18.0
registry-url: https://registry.npmjs.org
- run: npm ci
- name: The tag must match the version being published
run: |
tagged="${GITHUB_REF_NAME#v}"
packaged="$(node -p 'require("./package.json").version')"
test "$tagged" = "$packaged" || {
echo "tag $GITHUB_REF_NAME does not match package.json $packaged"
exit 1
}
- run: npm run lint
- run: npm test
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}