Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
name: publish

on:
push:
tags:
- "v*"

jobs:
tests:
uses: ./.github/workflows/tests.yml
publish-npm:
uses: brickhouse-tech/.github/.github/workflows/tests.yml@main
publish:
needs: [tests]
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
run: | # npm 11.15.1 for OIDC support
npm install -g npm@11
npm ci
npm install
npm publish --access public
uses: brickhouse-tech/.github/.github/workflows/publish.yml@main
56 changes: 5 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,13 @@
# TODO: ENABLE / UNCOMMENT WHEN NPM_TOKEN IS SET in secrets REPO
name: release

on:
push:
branches: ["master"]
tags-ignore: ['**']

jobs:
tests:
uses: ./.github/workflows/tests.yml
tag-release:
runs-on: ubuntu-latest
uses: brickhouse-tech/.github/.github/workflows/tests.yml@main
release:
needs: [tests]
steps:
- uses: actions/checkout@v4
with:
# important, must be defined on checkout to kick publish
token: ${{ secrets.GH_TOKEN }}
# Full history needed for conventional-changelog to detect breaking changes
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- name: tag release
run: |
# ignore if commit message is chore(release): ...
if [[ $(git log -1 --pretty=%B) =~ ^chore\(release\):.* ]]; then
echo "Commit message starts with 'chore(release):', skipping release"
exit 0
fi

git config --local user.email "creadbot@github.com"
git config --local user.name "creadbot_github"

npm install

# Check for breaking changes in commits since last tag
# Look for feat!:, fix!:, or BREAKING CHANGE in commit messages
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$LAST_TAG" ]; then
RANGE="$LAST_TAG..HEAD"
else
RANGE="HEAD"
fi

# Check all commits (not just first-parent) for breaking changes
if git log $RANGE --format="%B" | grep -qE "(^[a-z]+!:|BREAKING CHANGE:)"; then
echo "Breaking change detected, forcing major version bump"
npx commit-and-tag-version --release-as major
else
npx commit-and-tag-version
fi

git push
git push --tags
uses: brickhouse-tech/.github/.github/workflows/release.yml@main
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
20 changes: 2 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
name: tests

on:
workflow_call:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
test:
strategy:
matrix:
node-version: ['20.x', '22.x', '24.x']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# cache: "npm" # needs lockfile if enabled

- run: npm install
- run: npm run lint
- run: npm test
tests:
uses: brickhouse-tech/.github/.github/workflows/tests.yml@main
15 changes: 15 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import js from "@eslint/js";
import globals from "globals";

export default [
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
angular: "readonly",
},
},
},
];
Loading