chore(release): 1.7.2 #22
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
| name: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| registry-url: https://registry.npmjs.org | |
| - run: pnpm install --frozen-lockfile | |
| - name: Verify version match | |
| id: version | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| PKG_VERSION=$(node -p "require('./packages/cli/package.json').version") | |
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | |
| echo "::error::Tag v${TAG_VERSION} does not match packages/cli/package.json version ${PKG_VERSION}" | |
| exit 1 | |
| fi | |
| echo "version=$TAG_VERSION" >> "$GITHUB_OUTPUT" | |
| - run: pnpm checks | |
| - run: pnpm turbo run typecheck --filter=dubstack | |
| - run: pnpm turbo run test --filter=dubstack | |
| - name: Pack and compute SHA | |
| id: sha | |
| working-directory: packages/cli | |
| run: | | |
| TARBALL=$(pnpm pack | tail -1) | |
| SHA=$(shasum -a 256 "$TARBALL" | cut -d ' ' -f 1) | |
| echo "tarball=$TARBALL" >> "$GITHUB_OUTPUT" | |
| echo "sha256=$SHA" >> "$GITHUB_OUTPUT" | |
| - name: Publish to npm | |
| working-directory: packages/cli | |
| run: pnpm publish ${{ steps.sha.outputs.tarball }} --no-git-checks --provenance | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: wiseiodev/homebrew-dubstack | |
| token: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| path: homebrew-tap | |
| - name: Update Homebrew formula | |
| run: | | |
| cd homebrew-tap | |
| VERSION="${{ steps.version.outputs.version }}" | |
| SHA="${{ steps.sha.outputs.sha256 }}" | |
| sed -i "s|url \".*\"|url \"https://registry.npmjs.org/dubstack/-/dubstack-${VERSION}.tgz\"|" Formula/dubstack.rb | |
| sed -i "s|sha256 \".*\"|sha256 \"${SHA}\"|" Formula/dubstack.rb | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Formula/dubstack.rb | |
| git commit -m "dubstack ${VERSION}" | |
| git push origin HEAD:main |