Skip to content

Commit a10a03f

Browse files
committed
fix(release): implement semantic-release
1 parent 5293120 commit a10a03f

File tree

6 files changed

+77
-20
lines changed

6 files changed

+77
-20
lines changed

Diff for: .github/dependabot.yml

+4
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ updates:
88
directory: "/run"
99
schedule:
1010
interval: "daily"
11+
commit-message:
12+
prefix: fix
13+
prefix-development: chore
14+
include: scope

Diff for: .github/release.yml

-18
This file was deleted.

Diff for: .github/workflows/ci.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: CI
22

33
on:
44
pull_request:
5-
push:
6-
branches: main
75

86
jobs:
97
test:
@@ -22,3 +20,22 @@ jobs:
2220
- run: yarn test
2321
- run: yarn build
2422
- run: yarn lint
23+
24+
commitlint:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.pull_request.head.sha }}
30+
fetch-depth: 0 # need to get back to base
31+
- uses: actions/setup-node@v4
32+
- name: Install
33+
run: |
34+
npm install --save-dev @commitlint/cli
35+
npm install --save-dev @commitlint/config-conventional
36+
- name: Run
37+
run: |
38+
npx commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --color
39+
env:
40+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
41+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}

Diff for: .github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- rc/*
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
16+
17+
- id: token
18+
uses: actions/create-github-app-token@v1
19+
with:
20+
app-id: ${{ vars.AUTOMATION_APP_ID }}
21+
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
22+
23+
- id: release
24+
uses: cycjimmy/semantic-release-action@v4
25+
with:
26+
extra_plugins: |
27+
@semantic-release/exec
28+
semantic-release-major-tag
29+
env:
30+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}

Diff for: .releaserc.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins:
2+
- "@semantic-release/commit-analyzer"
3+
- "@semantic-release/release-notes-generator"
4+
- - "@semantic-release/github"
5+
- successCommentCondition: false
6+
7+
- "semantic-release-major-tag"
8+
9+
# Update dist, in case Dependabot PRs merged without doing so
10+
- - "@semantic-release/exec"
11+
- execCwd: run
12+
prepareCmd: "yarn install && yarn run build"
13+
14+
- - "@semantic-release/git"
15+
- assets: "run/dist/index.js"
16+
message: "chore(release): build dist"
17+
18+
branches:
19+
- main
20+
- name: rc/*
21+
prerelease: '${name.replace(/^rc\//g, "rc-")}'

Diff for: commitlint.config.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional']
3+
};

0 commit comments

Comments
 (0)