Merge pull request #235 from multiversx/development #73
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 sdk-dapp-ui | |
| on: | |
| push: | |
| branches: [main] | |
| repository_dispatch: | |
| types: publish-npm | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| clean: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Setup pnpm | |
| run: npm install -g pnpm | |
| - name: Install Chrome for Puppeteer | |
| run: | | |
| wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
| sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' | |
| sudo apt-get update | |
| sudo apt-get install -y google-chrome-stable | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run unit tests | |
| run: pnpm run test | |
| env: | |
| PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome-stable | |
| - name: Clear dist | |
| run: rm -rf dist | |
| - name: Build | |
| run: pnpm run build | |
| - name: Get package info | |
| id: package | |
| uses: andreigiura/action-nodejs-package-info@v1.0.2 | |
| - name: Publish to npmjs next version | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
| if: ${{ steps.package.outputs.is-prerelease == 'true'}} | |
| run: echo ${{ steps.package.outputs.is-prerelease}} && npm publish --tag next --no-git-checks | |
| - name: Publish to npmjs | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
| if: ${{ steps.package.outputs.is-prerelease == 'false' }} | |
| run: npm publish --no-git-checks |