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/nextjs' || github.repository == 'harperfast/nextjs'
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: '.nvmrc'
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
# Compile the plugin so a broken build fails the release before it publishes. `dist/` is gitignored
# and rebuilt on publish via the `prepublishOnly` script, so this also surfaces build errors early.
- name: Build
run: npm run build
- 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
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 .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "feat", "section": "Features" },
{ "type": "docs", "section": "Documentation" },
Comment thread
dawsontoth marked this conversation as resolved.
{ "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", "package-lock.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'],
},
};
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"url": "git+https://github.com/HarperFast/nextjs.git"
},
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"files": [
"dist/**",
"!dist/**/*.test.*",
Expand All @@ -40,7 +43,8 @@
"build": "tsc -p tsconfig.build.json",
"install:fixtures": "node scripts/install-fixtures.js",
"test": "npm run build && node --test \"dist/**/*.test.js\"",
"test:integration": "playwright test --config integrationTests/playwright.config.ts"
"test:integration": "playwright test --config integrationTests/playwright.config.ts",
"prepublishOnly": "npm run build"
Comment thread
dawsontoth marked this conversation as resolved.
},
"engines": {
"node": ">=20"
Expand Down
Loading