Skip to content

Commit

Permalink
restore
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jan 23, 2023
1 parent 271d487 commit 2475ecd
Showing 1 changed file with 58 additions and 2 deletions.
60 changes: 58 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,61 @@ name: Publish a package
on: workflow_dispatch

jobs:
publish:
uses: userscripters/shared-actions/.github/workflows/workflow-npm_publish.yml@master
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Using Node 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Update npm version to latest
run: npm install -g npm@latest
- name: Install dependencies
run: |
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
npm install
env:
NODE_AUTH_TOKEN: ${{github.token}}
- name: Compile
run: npm run build-all || npm run build
- name: Run tests
run: npm run test

publish-gh:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
scope: "@${{github.repository_owner}}"
- run: npm install
- run: |
npm config set @${{github.repository_owner}}:registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.PAT}}
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
scope: "@${{github.repository_owner}}"
- run: npm install
env:
NODE_AUTH_TOKEN: ${{github.token}}
- run: |
npm config set @${{github.repository_owner}}:registry https://registry.npmjs.org
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 2475ecd

Please sign in to comment.