fix npm-publish.yml #67
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
# This workflow builds the package and uploads it to the NPM repository | |
name: Publish to NPM | |
# Trigger with every commit on master | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build_and_publish_package: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Delete node_modules directory | |
run: rm -rf node_modules | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Copy package.json to dist directory | |
run: "cp package.json dist && sed -i 's/\"main\": \".*\"/\"main\": \"sportlink-to-mailchimp-converter.umd.js\"/' dist/package.json && sed -i 's/\"types\": \".*\"/\"types\": \"sportlink-to-mailchimp-converter.d.ts\"/' dist/package.json" | |
- name: Publish to npm | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: dist |