Skip to content

Commit

Permalink
set publish on release
Browse files Browse the repository at this point in the history
  • Loading branch information
Janin-Michel-Mathias committed Aug 29, 2024
1 parent a856414 commit 61a2177
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: On code change
name: On code change & merge

on: [push, pull_request]
on:
pull_request:
push:
branches:
- master

jobs:
build:
Expand Down Expand Up @@ -30,18 +34,4 @@ jobs:
run: |
yarn install
yarn test
publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '10.x'
- name: Publish to npm
run: |
yarn install
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
yarn publish --access public
20 changes: 20 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: On release
on:
release:
types: [published]

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '10.x'
- name: Publish to npm
run: |
yarn install
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_PUBLISH_TOKEN }}" > .npmrc
yarn publish --access public

0 comments on commit 61a2177

Please sign in to comment.