-
Notifications
You must be signed in to change notification settings - Fork 2
ci: add semantic-release workflow ported from @harperfast/vite #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" }, | ||
| { "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" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'], | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.