-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #87 Update `npm-publish.yml` workflow to correctly transpile and publish the application to NPM. * Add a step to copy `package.json` to the `dist` directory before publishing. * Modify the `main` and `types` properties in the copied `package.json` to point to the correct files.
- Loading branch information
1 parent
dc2f1fa
commit 332e1a5
Showing
1 changed file
with
33 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
# 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: Publish to npm | ||
uses: JS-DevTools/npm-publish@v3 | ||
with: | ||
token: ${{ secrets.NPM_AUTH_TOKEN }} | ||
package: dist | ||
# 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.umd.d.ts\"/' dist/package.json | ||
|
||
- name: Publish to npm | ||
uses: JS-DevTools/npm-publish@v3 | ||
with: | ||
token: ${{ secrets.NPM_AUTH_TOKEN }} | ||
package: dist |