Issue #224544 feat: Enable GitHub Actions to publish NPM package #113
Workflow file for this run
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: π Publish NPM Package | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
actions: write | |
packages: write | |
pull-requests: write | |
steps: | |
- name: π₯ Checkout Code Repository | |
uses: actions/checkout@v4 | |
- name: π§ Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
# registry-url: 'https://registry.npmjs.org' | |
- name: List files | |
run: ls -la ~/ | |
- name: Create .npmrc | |
run: echo "//registry.npmjs.org/:_authToken=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" > ~/.npmrc | |
- name: Display .npmrc contents | |
run: cat ~/.npmrc | |
- name: π¦ Install Dependencies | |
run: npm ci | |
- name: π οΈ Build Library | |
run: npm run build-lib | |
- name: List contents of dist/quml-library | |
run: ls -la dist/quml-library | |
- name: π’ Publish to NPM | |
run: | | |
cd dist/quml-library | |
pwd # Print the current directory | |
ls -la # List the contents to ensure the package is present | |
# npm pack | |
echo "-----------------------------------Package is packed---------------------------------------------" | |
# npm publish tekdi-sunbird-quml-player-*.tgz --tag=beta --access public | |
npm publish --tag=beta --access public | |
# env: | |
# NODE_AUTH_TOKEN: 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 |