Skip to content

Commit 6198aa0

Browse files
committed
chore: setup semantic release
1 parent 99512ba commit 6198aa0

File tree

8 files changed

+11339
-3136
lines changed

8 files changed

+11339
-3136
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Pull Requests
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
uses: ./.github/workflows/test.yml

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
uses: ./.github/workflows/test.yml
10+
release:
11+
runs-on: ubuntu-latest
12+
needs: test
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: "lts/*"
19+
- run: npm ci
20+
- run: npm run build
21+
- name: Release
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
GIT_AUTHOR_NAME: "ioredis robot"
26+
GIT_AUTHOR_EMAIL: "[email protected]"
27+
run: npx semantic-release

.github/workflows/main.yml renamed to .github/workflows/test.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
1-
# Runs ioredis lint, build, and test steps in docker.
2-
name: CI
3-
4-
# Controls when the action will run.
51
on:
6-
# Triggers the workflow on push or pull request events but only for the main branch
7-
push:
8-
branches:
9-
- main
10-
- greenkeeper**
11-
pull_request:
12-
branches:
13-
- main
14-
# Allows you to run this workflow manually from the Actions tab
15-
workflow_dispatch:
2+
workflow_call:
163

17-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
184
jobs:
195
test:
206
runs-on: ubuntu-latest
217
strategy:
228
fail-fast: false
239
matrix:
2410
node: [12.x, 14.x, 16.x]
25-
redis: [2, 6]
11+
redis: ['2', '6']
2612
steps:
2713
- name: Git checkout
2814
uses: actions/checkout@v2
@@ -43,6 +29,7 @@ jobs:
4329
- run: npm run test:tsd
4430
- run: npm run test:cov || npm run test:cov || npm run test:cov
4531
- name: Coveralls
32+
if: matrix.node == '16.x' && matrix.redis == '6'
4633
uses: coverallsapp/github-action@master
4734
with:
4835
github-token: ${{ secrets.GITHUB_TOKEN }}

.releaserc.json

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,22 @@
11
{
2-
"branch": "master",
3-
"verifyConditions": [
4-
"@semantic-release/npm",
5-
"@semantic-release/changelog",
6-
"@semantic-release/git",
7-
"@semantic-release/github"
8-
],
9-
"getLastRelease": "@semantic-release/git",
10-
"prepare": [
11-
{
12-
"path": "@semantic-release/changelog",
13-
"changelogFile": "Changelog.md"
14-
},
15-
"@semantic-release/npm",
16-
{
17-
"path": "@semantic-release/git",
18-
"assets": [
19-
"Changelog.md",
20-
"package.json",
21-
"package-lock.json",
22-
"npm-shrinkwrap.json"
23-
]
24-
}
2+
"branches": [
3+
"v4",
4+
{ "name": "main", "channel": "next", "prerelease": "beta" }
255
],
26-
"publish": [
27-
"@semantic-release/npm",
28-
"@semantic-release/github"
29-
],
30-
"analyzeCommits": {
31-
"preset": "angular",
32-
"releaseRules": [
33-
{ "type": "minor", "release": "minor" },
34-
{ "type": "patch", "release": "patch" },
35-
{ "type": "major", "release": "major" },
36-
{ "type": "breaking", "release": "major" }
37-
]
38-
}
6+
"plugins": [
7+
[
8+
"@semantic-release/commit-analyzer",
9+
{
10+
"preset": "angular",
11+
"parserOpts": {
12+
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
13+
}
14+
}
15+
],
16+
"@semantic-release/release-notes-generator",
17+
["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" }],
18+
"@semantic-release/git",
19+
"@semantic-release/github",
20+
"@semantic-release/npm"
21+
]
3922
}
File renamed without changes.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![ioredis](https://cdn.jsdelivr.net/gh/luin/ioredis@b5e8c74/logo.svg)](https://github.com/luin/ioredis)
22

3-
[![Build Status](https://github.com/luin/ioredis/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/luin/ioredis/actions/workflows/main.yml?query=branch%3Amain)
3+
[![Build Status](https://github.com/luin/ioredis/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/luin/ioredis/actions/workflows/release.yml?query=branch%3Amain)
44
[![Coverage Status](https://coveralls.io/repos/github/luin/ioredis/badge.svg?branch=main)](https://coveralls.io/github/luin/ioredis?branch=main)
55
[![Join the chat at https://gitter.im/luin/ioredis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/luin/ioredis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
66
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

0 commit comments

Comments
 (0)