-
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.
- Loading branch information
1 parent
7aac9ab
commit 95d195c
Showing
2 changed files
with
134 additions
and
0 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,60 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
semantic-release: | ||
name: Release | ||
if: "!contains(github.event.head_commit.message, 'SKIP CI')" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [14.x] | ||
steps: | ||
- name: Checkout branch (${{ github.ref }}) | ||
uses: actions/checkout@master | ||
- name: Configure git | ||
run: | | ||
git config user.name "Action" | ||
git config user.email "[email protected]" | ||
- name: Setup node (v${{ matrix.node-version }}) | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install packages | ||
run: | | ||
npm ci | ||
npm run build --if-present | ||
env: | ||
CI: true | ||
- name: Install release dependencies | ||
# see: https://github.com/semantic-release/changelog/issues/168 | ||
run: npm i --no-save @semantic-release/changelog@5 @semantic-release/exec@5 @semantic-release/git@9 | ||
- name: Build release | ||
run: npm run release | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_ADMIN || secrets.GITHUB_TOKEN }} # push release to remote repo | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} # publish package to registry | ||
- name: Sync to remote | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
continue-on-error: true | ||
- name: Sync to next | ||
if: "github.ref == 'refs/heads/master'" | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: next | ||
continue-on-error: true | ||
- name: Save bundle | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: Bundle | ||
path: dist | ||
continue-on-error: true |
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,74 @@ | ||
module.exports = { | ||
ci: false, | ||
branches: ["master", { name: "next", prerelease: true }], | ||
plugins: [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
preset: "angular", | ||
releaseRules: [ | ||
{ type: "feat", release: "minor" }, | ||
{ type: "style", release: "patch" }, | ||
{ type: "refactor", release: "patch" }, | ||
{ scope: "skip", release: false }, | ||
], | ||
parserOpts: { | ||
noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"], | ||
}, | ||
}, | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
preset: "conventionalcommits", | ||
presetConfig: { | ||
types: [ | ||
{ type: "feat", section: "✨ New & Improved", hidden: false }, | ||
{ type: "refactor", section: "✨ New & Improved", hidden: true }, | ||
|
||
{ type: "style", section: "💄 Style Refinements", hidden: false }, | ||
|
||
{ type: "fix", section: "🛠 Fixes & Updates", hidden: false }, | ||
{ type: "perf", section: "🛠 Fixes & Updates", hidden: false }, | ||
{ type: "chore", section: "🛠 Fixes & Updates", hidden: true }, | ||
{ type: "test", section: "🛠 Fixes & Updates", hidden: true }, | ||
|
||
{ type: "docs", section: "📘 Docs", hidden: false }, | ||
|
||
{ type: "build", hidden: true }, | ||
{ type: "ci", hidden: true }, | ||
], | ||
}, | ||
parserOpts: { | ||
noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"], | ||
}, | ||
writerOpts: { | ||
commitsSort: ["subject", "scope"], | ||
headerPartial: `## Version {{version}}`, | ||
}, | ||
}, | ||
], | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
changelogTitle: "Changelog\n===", | ||
}, | ||
], | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
npmPublish: false, | ||
tarballDir: "dist", | ||
}, | ||
], | ||
["@semantic-release/github"], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
assets: ["CHANGELOG.md", "package.json", "package-lock.json"], | ||
message: | ||
"Release v${nextRelease.version}\n\n${nextRelease.notes}\n<!--SKIP CI-->", | ||
}, | ||
], | ||
], | ||
}; |