Skip to content

Commit b3f0cc5

Browse files
ci: Add a simple quality workflow which should run on all branches
1 parent 29ffb68 commit b3f0cc5

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

.github/workflows/quality.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Quality
2+
3+
on:
4+
pull_request: # Run this workflow for all pull request changes
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
repository_dispatch: # Run this workflow when base branch updates
10+
types: [base_branch_updated]
11+
12+
jobs:
13+
quality:
14+
runs-on: ubuntu-latest
15+
if: ${{ !contains(github.event.head_commit.message, '[ci-skip]') }}
16+
steps:
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-node@v6
19+
with:
20+
node-version: 24
21+
registry-url: 'https://registry.npmjs.org'
22+
- name: Update npm
23+
run: npm install -g npm@latest
24+
- name: Install dependencies
25+
run: npm ci
26+
env:
27+
HUSKY: 0 # Disable husky within CI/CD
28+
- name: Run quality checks
29+
run: npm run quality
30+
- name: Build project
31+
run: npm run build
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
name: Publish to NPM
1+
name: Release
22

33
on:
44
push:
55
branches:
6-
- 'main'
6+
- main
77

88
permissions:
99
id-token: write # Required for OIDC / NPM Trusted Publishing (https://repos.openssf.org/trusted-publishers-for-all-package-repositories)
10+
issues: write
1011
contents: write
12+
pull-requests: write
1113

1214
jobs:
13-
quality-bump-and-publish:
15+
release:
1416
runs-on: ubuntu-latest
15-
if: ${{ !contains(github.event.head_commit.message, '[ci-skip]') }}
1617
steps:
1718
- uses: actions/checkout@v6
1819
- uses: actions/setup-node@v6
@@ -21,28 +22,23 @@ jobs:
2122
registry-url: 'https://registry.npmjs.org'
2223
- name: Update npm
2324
run: npm install -g npm@latest # NPM Trusted Publishing requires npm 11.5.1 or later
25+
- name: Install dependencies
26+
run: npm ci
27+
env:
28+
HUSKY: 0 # Disable husky within CI/CD
2429
- name: Configure git
2530
run: |
2631
git config user.name "GitHub Actions Bot"
2732
git config user.email "github-actions-bot@users.noreply.github.com"
28-
- name: Install npm dependencies
29-
run: npm ci
30-
env:
31-
HUSKY: 0
32-
- name: Run quality checks
33-
run: npm run quality
33+
- uses: googleapis/release-please-action@v4
34+
with:
35+
release-type: node
3436
- name: Build project
37+
if: ${{ steps.release.outputs.release_created }}
3538
run: npm run build
36-
- name: Run standard-version to bump version
37-
run: npm run release
38-
- name: Push version bump to main
39-
uses: ad-m/github-push-action@master
40-
with:
41-
github_token: ${{ secrets.GITHUB_TOKEN }}
42-
branch: main
43-
tags: true
44-
force: true
4539
- name: Bundle tarball
40+
if: ${{ steps.release.outputs.release_created }}
4641
run: npm run package
4742
- name: Publish to npm
43+
if: ${{ steps.release.outputs.release_created }}
4844
run: npm publish

0 commit comments

Comments
 (0)