name: release on: push: tags: - v* jobs: check_branch: runs-on: ubuntu-latest outputs: should_build: ${{ steps.permitted.outputs.result }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Fetch remote branches run: | git fetch origin --depth=1 - name: Check if on permitted branch id: permitted run: | result= if git branch -a --contains $GITHUB_SHA | grep -q 'remotes/origin/master$'; then result=true elif git branch -a --contains $GITHUB_SHA | grep -q 'remotes/origin/.*-release$'; then result=true fi echo "result=${result}" >> "$GITHUB_OUTPUT" release: runs-on: ubuntu-22.04 needs: check_branch permissions: contents: write id-token: write if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_build }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Setup Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: '.nvmrc' registry-url: 'https://registry.npmjs.org' package-manager-cache: false - name: Update npm run: npm install --global npm@^11.15.0 - name: Enable Corepack run: corepack enable yarn - name: Install dependencies run: yarn - name: Build packages run: yarn build - name: Run tests from transpiled code run: yarn test-fast - name: Publish to NPM run: npx ocular-publish from-git