Skip to content

Commit

Permalink
ci: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lsndr committed Dec 25, 2023
1 parent 7089eb7 commit a8b645a
Show file tree
Hide file tree
Showing 5 changed files with 2,643 additions and 46 deletions.
File renamed without changes.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release
on:
push:
branches:
- ci/use-semantic-release
- master
- next
- "*.x"

permissions:
contents: read # for checkout

jobs:
build_and_test:
uses: ./.github/workflows/build-and-test.yml
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
needs:
- build_and_test
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CI_GITHUB_TOKEN }}
persist-credentials: false
- name: Setup LTS Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release --dry-run
47 changes: 47 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{ "type": "docs", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "revert", "release": "patch" }
]
}
],
[
"@semantic-release/release-notes-generator",
{
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "build", "section": "Build System", "hidden": false },
{ "type": "chore", "section": "Build System", "hidden": false },
{ "type": "chore", "scope": "merge", "section": "Build System", "hidden": true },
{ "type": "ci", "section": "Continuous Integration", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
{ "type": "refactor", "section": "Code Refactoring", "hidden": false },
{ "type": "revert", "section": "Reverted Changes", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false }
]
},
"writerOpts": {
"commitsSort": ["subject", "scope"]
}
}
],
"@semantic-release/github",
"@semantic-release/npm",
"@semantic-release/git"
],
"branches": ["+([0-9])?(.{+([0-9]),x}).x", "master", {"name": "next", "prerelease": true}, {"name": "ci/use-semantic-release", "prerelease": "test"}]
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@
"lint": "cargo fmt --all -- --check && eslint \"**/*.{js,ts,json}\" --max-warnings=0",
"lint:fix": "cargo fmt --all && yarn lint --fix",
"lint:fix-staged": "lint-staged"
},
"dependencies": {
"semantic-release": "^22.0.12"
}
}
Loading

0 comments on commit a8b645a

Please sign in to comment.