Skip to content

fix npm-publish.yml #67

fix npm-publish.yml

fix npm-publish.yml #67

Workflow file for this run

# 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