Skip to content

Commit

Permalink
ci: configure semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
sblask committed Apr 23, 2024
1 parent 383f085 commit 21f4a86
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: release

on:
pull_request:
push:
branches:
- main
- manifest-v3

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
pre-commit:
uses:
./.github/workflows/pre-commit.yml
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v4
with:
node-version: latest
- name: pushed commits count
id: pushed_commits_count
env:
pushed_commits: ${{ toJson(github.event.commits) }}
run: |
echo "pushed_commits_count=$(echo "$pushed_commits" | jq '. | length')" >> "$GITHUB_OUTPUT"
- run: npm install
- run: npx commitlint --verbose --from HEAD~${{ github.event_name == 'pull_request' && github.event.pull_request.commits || steps.pushed_commits_count.outputs.pushed_commits_count }} --to HEAD
- run: npx semantic-release ${{ github.event_name == 'pull_request' && '--dry-run' || '' }}
15 changes: 15 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"branches": [
"main",
{
"name": "manifest-v3",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/npm",
"@semantic-release/release-notes-generator"
],
"tagFormat": "${ version }"
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"@commitlint/cli": "^19.0.3",
"@commitlint/config-angular": "^19.0.3",
"@eslint/js": "^8.54.0",
"@semantic-release/exec": "github:semantic-release/exec",
"@stylistic/eslint-plugin-js": "^1.4.0",
"eslint": "^8.54.0",
"semantic-release": "^23.0.2",
"web-ext": "^7.8.0"
},
"name": "webextension-do-not-close-browser-with-last-tab",
Expand Down

0 comments on commit 21f4a86

Please sign in to comment.