From 890a20df676a515f7761056e8af4051de5272902 Mon Sep 17 00:00:00 2001 From: Sebastian Blask Date: Sun, 3 Mar 2024 22:29:11 +1300 Subject: [PATCH] ci: configure semantic release --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ .releaserc.json | 15 +++++++++++++++ package.json | 2 ++ 3 files changed, 47 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bba2dd4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +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 + - uses: actions/setup-node@v4 + - run: npx commitlint --from ${{ github.event_name == 'pull_request' && github.event.push.base_ref || github.event.push.before }} --to HEAD + - run: npm install + - run: npx semantic-release ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..77ad234 --- /dev/null +++ b/.releaserc.json @@ -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 }" +} diff --git a/package.json b/package.json index 500eda2..52a0eee 100644 --- a/package.json +++ b/package.json @@ -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-tab-deque",