11
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2026-04-05 21:46:54 +00:00

feat: add a new output - "new-release-published"

This commit is contained in:
cycjimmy 2019-10-17 20:33:41 +08:00
parent ddd286be06
commit be8f403201
4 changed files with 71 additions and 3 deletions

View file

@ -16,8 +16,35 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js with GitHub Package Registry
uses: actions/setup-node@v1
with:
node-version: 12
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
registry-url: 'https://npm.pkg.github.com'
scope: 'cycjimmy'
always-auth: true
- name: Setup Node.js with Npm Package Registry
uses: actions/setup-node@v1
with:
node-version: 12
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
registry-url: 'https://registry.npmjs.org'
always-auth: true
- name: Set .npmrc
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > /home/runner/work/_temp/.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> /home/runner/work/_temp/.npmrc
- name: Semantic Release
uses: cycjimmy/semantic-release-action@master
id: semantic
with:
branch: master
extra_plugins: |
@ -26,3 +53,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish To GitHub Package Registry
if: steps.semantic.outputs.new-release-published == 'true'
run: npm publish --@cycjimmy:registry='https://npm.pkg.github.com'
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}