Skip to content

Publish Packages

Publish Packages #11

Workflow file for this run

name: Publish Packages
on:
release:
types: [created]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm test
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v1
with:
node-version: '12'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run compile
# Publish to npm
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_NPM_TOKEN }}
publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: '@emandm'
# Publish to GitHub Packages
- run: npm ci
- run: npm run compile
- name: Update Package Name
run: |
sed -i 's,"name": "ts-mock-imports","name": "@emandm/ts-mock-imports",' package.json
cat package.json
- run: echo registry=https://npm.pkg.github.com/emandm >> .npmrc
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}