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
59 changes: 59 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on:
merge_group:
branches:
- main
push:
branches:
- main
workflow_dispatch:

# Needed for semantic-release to create GitHub releases and publish to npm via OIDC
permissions:
contents: write
issues: write
pull-requests: write
id-token: write

concurrency:
group: Release
cancel-in-progress: false

jobs:
release:
name: Release
environment: Release
# Ensure releases run only when code reaches main via GitHub Merge Queue, or when manually dispatched
runs-on: ubuntu-latest
if: github.repository == 'HarperFast/vite-plugin' || github.repository == 'harperfast/vite-plugin'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: '.nvmrc'
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Check format
run: npm run format:check
- name: Run unit tests
run: npm run test:coverage
- name: Semantic Release
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'merge_group' && github.event.merge_group.base_ref == 'refs/heads/main') }}
uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0
with:
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/npm
@semantic-release/git
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
20 changes: 20 additions & 0 deletions .github/workflows/verify-commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Verify Commits

on:
pull_request:
types: [opened, synchronize, edited, reopened, ready_for_review]
push:
branches: [main]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Commitlint
uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1
with:
configFile: commitlint.config.cjs
33 changes: 33 additions & 0 deletions .github/workflows/verify-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Verify PR

on:
workflow_dispatch:
pull_request:
branches: [main]

jobs:
verify:
name: Verify (Node ${{ matrix.node-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [20, 22, 24]
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Check format
run: npm run format:check
- name: Run unit tests
run: npm run test:coverage
34 changes: 34 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "feat", "section": "Features" },
{ "type": "feature", "section": "Features" },
{ "type": "docs", "section": "Documentation" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "perf", "section": "Performance Improvements" },
{ "type": "refactor", "section": "Code Improvements" },
{ "type": "revert", "section": "Reverts" },
{ "type": "test", "section": "Test Improvements" },
{ "type": "chore", "scope": "deps", "section": "Dependency Updates" }
]
}
}
],
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": ["package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
8 changes: 8 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [0, 'never'],
'body-max-line-length': [0, 'never'],
'footer-max-line-length': [0, 'never'],
},
};
1 change: 1 addition & 0 deletions example-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hello Vite</h1>
2 changes: 2 additions & 0 deletions example-app/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { defineConfig } from 'vite';
export default defineConfig({});
Loading