v2.6.0-rc.3 #27
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
| # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
| # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
| name: Node.js Package | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.release.target_commitish }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Clear NPM cache | |
| run: npm cache clean --force | |
| - name: Install dependencies and build | |
| run: npm ci | |
| - name: Make release | |
| run: npm run build | |
| id: makeRelease | |
| - name: Fail job if makeRelease failed | |
| if: steps.makeRelease.outcome == 'failure' | |
| run: exit 1 | |
| id: check-build-status | |
| - name: Publish NPM package (regular) | |
| if: "!github.event.release.prerelease" | |
| run: | | |
| npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.npm_token}} | |
| - name: Publish NPM package (pre-release) | |
| if: "github.event.release.prerelease" | |
| run: | | |
| npm publish --tag next | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.npm_token}} | |
| - name: Get Package version | |
| id: version | |
| run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | |
| - name: Publish to CDN Cloudflar R2 | |
| uses: ryand56/[email protected] | |
| with: | |
| r2-account-id: ${{ secrets.CDN_MAPTILER_ACCOUNT_ID }} | |
| r2-access-key-id: ${{ secrets.CDN_MAPTILER_ACCESS_KEY_ID }} | |
| r2-secret-access-key: ${{ secrets.CDN_MAPTILER_SECRET_ACCESS_KEY }} | |
| r2-bucket: cdn-storage | |
| source-dir: dist | |
| destination-dir: /client-js/v${{ env.PACKAGE_VERSION }}/ |