name: release on: push: tags: ["v*"] permissions: contents: write jobs: test: name: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - run: npm ci - name: Run tests run: npm test || echo "No tests configured" update-homebrew: name: update-homebrew needs: test runs-on: ubuntu-latest steps: - name: Get version id: version run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" - name: Wait for npm registry propagation run: sleep 60 - name: Get npm tarball checksum id: checksums run: | VERSION="${GITHUB_REF_NAME#v}" URL="https://registry.npmjs.org/@saiden/browse/-/browse-${VERSION}.tgz" curl -fsSL "${URL}" -o npm-tarball.tgz sha=$(sha256sum npm-tarball.tgz | cut -d' ' -f1) echo "npm_sha=${sha}" >> "$GITHUB_OUTPUT" - name: Update Homebrew formula env: GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | VERSION="${{ steps.version.outputs.version }}" SHA_NPM="${{ steps.checksums.outputs.npm_sha }}" cat > /tmp/browse.rb <