Skip to content

chore(release): bump version to 1.3.0 #16

chore(release): bump version to 1.3.0

chore(release): bump version to 1.3.0 #16

Workflow file for this run

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('./package.json').version")
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Tag v${TAG_VERSION} does not match package.json version ${PKG_VERSION}"
exit 1
fi
echo "version=$TAG_VERSION" >> "$GITHUB_OUTPUT"
- run: pnpm checks
- run: pnpm typecheck
- run: pnpm test
- name: Pack and compute SHA
id: sha
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
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