Skip to content

Commit a1b3dd8

Browse files
committed
fix: introduce semantic release
1 parent 4f21772 commit a1b3dd8

File tree

4 files changed

+3722
-511
lines changed

4 files changed

+3722
-511
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release:
8+
if: "!contains(github.event.head_commit.message, 'skip ci')"
9+
name: Release
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v1
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 12
18+
- name: Install dependencies
19+
run: npm install
20+
# TODO run build:package and prepare npm package for release
21+
- name: Release
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
24+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
run: npx semantic-release
26+
- name: Publish github pages
27+
run: |
28+
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/waoai/react-image-annotate.git
29+
npm run gh-pages -- -u "github-actions-bot <support+actions@github.com>"
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}

.releaserc.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
branch: "master",
3+
plugins: [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
["@semantic-release/npm", { npmPublish: true }],
7+
"@semantic-release/github",
8+
[
9+
"@semantic-release/git",
10+
{
11+
assets: ["package.json"],
12+
message:
13+
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
14+
}
15+
]
16+
]
17+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@fortawesome/react-fontawesome": "^0.1.3",
88
"@material-ui/core": "^4.6.0",
99
"@material-ui/icons": "^4.9.1",
10+
"@semantic-release/git": "^9.0.0",
1011
"get-image-data": "^3.0.1",
1112
"material-survey": "^1.0.34",
1213
"moment": "^2.23.0",

0 commit comments

Comments
 (0)