-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: initial semantic release with actionlint (#7)
* ci: initial semantic release with actionlint * fix linter feedback * Update .releaserc Co-authored-by: Sergi Philipsen <philipsen.sergi@gmail.com> --------- Co-authored-by: Sergi Philipsen <philipsen.sergi@gmail.com>
- Loading branch information
1 parent
ca6b6a8
commit 069f427
Showing
5 changed files
with
176 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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,24 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
actionlinter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #4.1.1 | ||
|
||
- name: Lint GitHub Actions | ||
uses: docker://rhysd/actionlint:latest | ||
with: | ||
options: -v $(pwd):/repo --workdir /repo | ||
args: -color |
This file contains 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
This file contains 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
This file contains 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,51 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
actionlinter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #4.1.1 | ||
|
||
- name: Lint GitHub Actions | ||
uses: docker://rhysd/actionlint:1.7.1 | ||
with: | ||
options: -v $(pwd):/repo --workdir /repo | ||
args: -color | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- actionlinter | ||
steps: | ||
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #4.1.1 | ||
with: | ||
token: ${{ secrets.WEAREFRANK_BOT_PAT }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #4.0.2 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Install dependencies | ||
run: yarn global add semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/exec @semantic-release/release-notes-generator @semantic-release/commit-analyzer conventional-changelog-conventionalcommits | ||
|
||
- name: Semantic Release | ||
run: semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.WEAREFRANK_BOT_PAT }} | ||
GH_TOKEN: ${{ secrets.WEAREFRANK_BOT_PAT }} |
This file contains 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,85 @@ | ||
{ | ||
"branches": ["main", "1.0.x"], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits", | ||
"releaseRules": [ | ||
{"breaking": true, "release": "major"}, | ||
{"type": "feat", "release": "minor"}, | ||
{"type": "fix", "release": "patch"}, | ||
{"type": "perf", "release": "patch"}, | ||
{"type": "revert", "release": "patch"}, | ||
{"type": "docs", "release": "patch"}, | ||
{"type": "style", "release": "patch"}, | ||
{"type": "refactor", "release": "patch"}, | ||
{"type": "test", "release": "patch"}, | ||
{"type": "build", "release": "patch"}, | ||
{"type": "ci", "release": "patch"}, | ||
{"type": "chore", "release": false} | ||
], | ||
"parserOpts": { | ||
"noteKeywords": [ | ||
"BREAKING CHANGE", | ||
"BREAKING CHANGES", | ||
"BREAKING" | ||
] | ||
} | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"parserOpts": { | ||
"noteKeywords": [ | ||
"BREAKING CHANGE", | ||
"BREAKING CHANGES", | ||
"BREAKING" | ||
] | ||
}, | ||
"writerOpts": { | ||
"commitsSort": ["subject", "scope"] | ||
}, | ||
"presetConfig": { | ||
"types": [ | ||
{"type": "feat", "section": "π Features"}, | ||
{"type": "feature", "section": "π Features"}, | ||
{"type": "fix", "section": "π Bug Fixes"}, | ||
{"type": "perf", "section": "π₯ Performance Improvements"}, | ||
{"type": "revert", "section": "β© Reverts"}, | ||
{"type": "docs", "section": "π Documentation"}, | ||
{"type": "style", "section": "π¨ Styles"}, | ||
{"type": "refactor", "section": "π§βπ» Code Refactoring"}, | ||
{"type": "test", "section": "β Tests"}, | ||
{"type": "build", "section": "π€ Build System"}, | ||
{"type": "ci", "section": "π Continuous Integration"} | ||
] | ||
} | ||
} | ||
], | ||
[ | ||
"@semantic-release/exec", { | ||
"verifyReleaseCmd": "echo \"release-tag=v${nextRelease.version}\" >> $GITHUB_OUTPUT; echo \"release-version=${nextRelease.version}\" >> $GITHUB_OUTPUT; echo \"release-type=${nextRelease.type}\" >> $GITHUB_OUTPUT" | ||
} | ||
], | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md", | ||
"changelogTitle": "[![conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org) [![semantic versioning](https://img.shields.io/badge/semantic%20versioning-2.0.0-green.svg)](https://semver.org)" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"CHANGELOG.md" | ||
], | ||
"message": "chore(<%= nextRelease.type %>): release <%= nextRelease.version %> <%= nextRelease.channel !== null ? `on ${nextRelease.channel} channel ` : '' %>[skip ci]\n\n<%= nextRelease.notes %>" | ||
} | ||
], | ||
"@semantic-release/github" | ||
] | ||
} |