.github/workflows/merge-jobs.yml
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Release on: push: branches: [ master ] jobs: build-publish: runs-on: ubuntu-latest # 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 steps: - name: Cancel Workflow Action uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} - name: Checkout uses: actions/checkout@v4 with: persist-credentials: false - name: Read .nvmrc run: echo ::set-output name=NVMRC::$(cat .nvmrc) id: nvm - name: Use Node.js ${{ steps.nvm.outputs.NVMRC }} uses: actions/setup-node@v4 with: node-version: ${{ steps.nvm.outputs.NVMRC }} - name: Install pnpm uses: pnpm/action-setup@v2 with: version: 8 run_install: false - name: Get pnpm store directory shell: bash run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - name: Setup pnpm cache uses: actions/cache@v4 with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: Build and publish NPM package env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | pnpm install pnpm run build pnpm run semantic-release - name: Test & publish code coverage uses: paambaati/codeclimate-action@v9.0.0 env: CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} with: coverageCommand: pnpm run coverage coverageLocations: | ${{github.workspace}}/coverage/lcov.info:lcov