chore(): npm-publish #47
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: npm-publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Node.js | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
registry-url: "https://registry.npmjs.org/" | |
token: ${{ secrets.NPM_TOKEN }} # Auth for npm | |
# Step 3: Install pnpm | |
- name: Install npm | |
run: npm ci | |
# Step 5: Build the library with pnpm | |
- name: Build ng-mdx | |
run: npm run lib.build | |
# Step 6: Copy the root README.md to the library folder | |
- name: Copy README.md to library folder | |
run: cp README.md dist/ngx-md/README.md | |
- name: Publish to npm | |
run: npm publish |