This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
Merge pull request #388 from deriv-com/fixed-accordion-id #168
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: release libs to github npm packages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'libs/hooks/**' | |
- 'libs/blocks/**' | |
- 'libs/components/**' | |
- 'libs/providers/**' | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
id-token: write # to enable use of OIDC for npm provenance | |
packages: write | |
jobs: | |
build: | |
name: Build and Publish Libs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Setup Git | |
run: | | |
git config user.name "prince-deriv" | |
git config user.email "[email protected]" | |
- name: Install dependencies | |
run: npm ci | |
- uses: marceloprado/[email protected] | |
id: changed-hooks | |
with: | |
paths: libs/hooks | |
- uses: marceloprado/[email protected] | |
id: changed-providers | |
with: | |
paths: libs/providers | |
- uses: marceloprado/[email protected] | |
id: changed-components | |
with: | |
paths: libs/components | |
- uses: marceloprado/[email protected] | |
id: changed-blocks | |
with: | |
paths: libs/blocks | |
- name: Bump version Hooks | |
if: steps.changed-hooks.outputs.changed == 'true' | |
shell: bash | |
run: npx nx run hooks:version --skip-nx-cache | |
- name: Bump version Blocks | |
if: steps.changed-blocks.outputs.changed == 'true' | |
shell: bash | |
run: npx nx run blocks:version --skip-nx-cache | |
- name: Bump version Components | |
if: steps.changed-components.outputs.changed == 'true' | |
shell: bash | |
run: npx nx run components:version --skip-nx-cache | |
- name: Bump version Providers | |
if: steps.changed-providers.outputs.changed == 'true' | |
shell: bash | |
run: npx nx run providers:version --skip-nx-cache | |
- name: Create npmrc file | |
shell: bash | |
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.PUBLISH_NPM_TOKEN }}' > .npmrc | |
- name: Publish Hooks | |
if: steps.changed-hooks.outputs.changed == 'true' | |
shell: bash | |
run: npx nx run hooks:deploy --skip-nx-cache | |
- name: Publish Blocks | |
if: steps.changed-blocks.outputs.changed == 'true' | |
shell: bash | |
run: npx nx run blocks:deploy --skip-nx-cache | |
- name: Publish Components | |
if: steps.changed-components.outputs.changed == 'true' | |
shell: bash | |
run: npx nx run components:deploy --skip-nx-cache | |
- name: Publish Providers | |
if: steps.changed-providers.outputs.changed == 'true' | |
shell: bash | |
run: npx nx run providers:deploy --skip-nx-cache | |
- name: Push Tags and Commits | |
shell: bash | |
run: git push origin main --follow-tags |