Workflow file for this run
This file contains hidden or 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 package to GitHub Packages | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: yarn | |
| - name: Install JavaScript dependencies | |
| shell: bash | |
| run: yarn install | |
| - name: Extract version without tag | |
| id: version | |
| run: echo "PACKAGE_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT | |
| - name: Update package versions | |
| run: | | |
| for pkg in packages/*/package.json; do | |
| node -e " | |
| const pkg = require('./$pkg'); | |
| pkg.version = '${{ steps.version.outputs.PACKAGE_VERSION }}'; | |
| require('fs').writeFileSync('./$pkg', JSON.stringify(pkg, null, 2) + '\n'); | |
| " | |
| done | |
| - name: Build clients | |
| shell: bash | |
| run: yarn build | |
| - name: Publish to NPM | |
| shell: bash | |
| run: yarn release:publish | |
| env: | |
| NPM_AUTH_TOKEN: ${{ secrets.CLINIA_CI_GITHUB_TOKEN }} |