Publish Packages #80
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 | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
workflow_dispatch: | |
inputs: | |
package: | |
type: choice | |
description: 'Choose the package to publish' | |
required: true | |
options: | |
- core | |
- react | |
jobs: | |
publish-core-library: | |
environment: CI | |
runs-on: ubuntu-latest | |
if: "(github.event_name == 'workflow_dispatch' && github.event.inputs.package == 'core') || contains(github.event.head_commit.message, 'release-please--branches--main--components--cardano-connect-with-wallet-core')" | |
defaults: | |
run: | |
working-directory: ./core | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 🫡 Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: '18.12.0' | |
registry-url: 'https://registry.npmjs.org/' | |
- name: 📥 Install dependencies | |
run: npm ci | |
- name: 📦 Bundle package | |
run: npm run build | |
- name: 🚀 Publish packages on npmjs | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_SECRET }} | |
publish-react-library: | |
environment: CI | |
runs-on: ubuntu-latest | |
if: "(github.event_name == 'workflow_dispatch' && github.event.inputs.package == 'react') || contains(github.event.head_commit.message, 'release-please--branches--main--components--cardano-connect-with-wallet') && !contains(github.event.head_commit.message, 'cardano-connect-with-wallet-core')" | |
defaults: | |
run: | |
working-directory: ./react | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 🫡 Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: '18.12.0' | |
registry-url: 'https://registry.npmjs.org/' | |
- name: 📥 Install dependencies | |
run: npm ci | |
- name: 🧵 Install rollup | |
run: npm i -g rollup | |
- name: 📦 Bundle package | |
run: npm run rollup | |
- name: 🚀 Publish packages on npmjs | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_SECRET }} |