-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(release): activate semantic release
- Loading branch information
Showing
5 changed files
with
163 additions
and
3 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,11 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: npm | ||
directory: / | ||
schedule: | ||
interval: daily |
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,45 @@ | ||
name: Dependabot post-update | ||
on: | ||
pull_request_target: | ||
types: [opened, synchronize, reopened] | ||
branches: main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
post-update: | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Checkout out pull request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr checkout ${{ github.event.pull_request.number }} | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- run: npm install --frozen-lockfile | ||
|
||
- run: npm run prepare | ||
|
||
- name: Commit and push if needed | ||
run: | | ||
git add . | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "💾 no changes to dist/index.js" | ||
exit 0 | ||
fi | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git commit -m "Apply dist/index.js changes" | ||
git push | ||
echo "💾 pushed dist/index.js changes" |
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,37 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'npm' | ||
|
||
- run: npm run prepare | ||
- name: Compare the expected and actual dist/ directories | ||
run: | | ||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then | ||
echo "❌ Detected uncommitted changes after build. See status below:" | ||
git diff | ||
exit 1 | ||
fi | ||
- name: 📦 Semantic Release | ||
if: github.ref == 'refs/heads/main' | ||
id: release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
with: | ||
extra_plugins: | | ||
@semantic-release/exec | ||
@semantic-release/git | ||
@semantic-release/release-notes-generator | ||
conventional-changelog-conventionalcommits | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,68 @@ | ||
{ | ||
"branches": "main", | ||
"debug": "false", | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"presetConfig": { | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": ":rocket: Features", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "features", | ||
"section": ":rocket: Features", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": ":bug: Bug Fixes", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": ":memo: Documentation", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "style", | ||
"section": ":barber: Styles", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "refactor", | ||
"section": ":zap: Code Refactoring", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "perf", | ||
"section": ":fast_forward: Performance Improvements", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "test", | ||
"section": ":white_check_mark: Tests", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "ci", | ||
"section": ":repeat: Continuous Integration", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Miscellaneous Chores", | ||
"hidden": false | ||
} | ||
] | ||
} | ||
} | ||
] | ||
] | ||
} |
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