Skip to content

Merge branch 'main' into dev #6

Merge branch 'main' into dev

Merge branch 'main' into dev #6

name: Publish Packages Automatically
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: false
on:
push:
branches:
- main
paths:
- 'sdk/sdk-common/bundle/package.json'
- 'sdk/sdk-client/bundle/package.json'
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
common_changed: ${{ steps.common-version-check.outputs.changed }}
client_changed: ${{ steps.client-version-check.outputs.changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- id: common-version-check
run: |
if git diff HEAD^ HEAD -- sdk/sdk-common/bundle/package.json | grep '"version":'; then
echo "::set-output name=changed::true"
else
echo "::set-output name=changed::false"
fi
- id: client-version-check
run: |
if git diff HEAD^ HEAD -- sdk/sdk-client/bundle/package.json | grep '"version":'; then
echo "::set-output name=changed::true"
else
echo "::set-output name=changed::false"
fi
publish-common:
name: Publish Common Package
runs-on: ubuntu-latest
needs: prepare
if: ${{ needs.prepare.outputs.common_changed == 'true' }}
steps:
- name: Checkout all files
id: checkout
uses: actions/checkout@v4
- name: Publish the package to npmjs
id: build_image
uses: ./.github/actions/publish-common
with:
npm_access_token: ${{ secrets.NPM_ACCESS_TOKEN }}
publish-client:
name: Publish Client Package
runs-on: ubuntu-latest
needs: prepare
if: ${{ needs.prepare.outputs.client_changed == 'true' }}
steps:
- name: Checkout all files
id: checkout
uses: actions/checkout@v4
- name: Publish the package to npmjs
id: build_image
uses: ./.github/actions/publish-client
with:
npm_access_token: ${{ secrets.NPM_ACCESS_TOKEN }}