Publish packages to respective artifactories #7
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 packages to respective artifactories | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20.11.1 | |
- run: npm ci | |
- run: npm run pre-build | |
- run: npm run build | |
- run: npm test | |
publish-to-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.11.1 | |
registry-url: https://registry.npmjs.org/ | |
- name: Publish to npm | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} | |
publish-to-github: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20.11.1 | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@ganezdragon" | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |