Skip to content

feat: Envoie de l'information sur la production d'un opérateur #130

feat: Envoie de l'information sur la production d'un opérateur

feat: Envoie de l'information sur la production d'un opérateur #130

Workflow file for this run

name: Check and publish types package
on:
pull_request:
paths:
- 'lib/**/*.d.ts'
- 'lib/package.json'
push:
branches:
- main
paths:
- 'lib/**/*.d.ts'
- 'lib/package.json'
jobs:
publish-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
registry-url: 'https://registry.npmjs.org/'
scope: '@agencebio'
# Get the version from the package.json file and check its different from the last version published
- run: echo "version=$(node -p "require('./lib/package.json').version")" >> $GITHUB_ENV
- run: echo "last_version=$(npm show @agencebio/cartobio-types version)" >> $GITHUB_ENV
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Test if version has been bumped so we can publish new types package
run: test $version != $last_version
shell: bash
# Publish the package if the version has changed
- run: npm publish --access public
if: github.ref == 'refs/heads/main'
working-directory: lib
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}