Deploy to npm #1219
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to npm | |
on: | |
schedule: | |
# Daily run | |
- cron: "0 4 * * *" | |
workflow_dispatch: null | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
cache: npm | |
- run: git pull --tags | |
- run: npm install | |
- run: npm run build | |
- run: npm test | |
- name: Create packages for .d.ts files | |
run: node deploy/createTypesPackages.js | |
- name: "Deploy built packages to NPM" | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | |
npm i -g npm@latest | |
npm whoami | |
node deploy/deployChangedPackages.js | |
env: | |
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |