Skip to content

Commit 01fcdfd

Browse files
committed
chore(ci): setup release with semantic-release
1 parent 2fdfc75 commit 01fcdfd

File tree

5 files changed

+7877
-35
lines changed

5 files changed

+7877
-35
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
tests:
10+
name: Test or Build
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: 12
18+
- name: Install dependencies
19+
env:
20+
CI: true
21+
run: |
22+
yarn install
23+
yarn ci
24+
- name: Build All Packages
25+
run: yarn run build
26+
27+
publish:
28+
needs: tests
29+
name: Publish to Github & NPM or Github Package Registry
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v2
33+
- uses: actions/setup-node@v2
34+
with:
35+
node-version: 12
36+
- env:
37+
CI: true
38+
run: |
39+
yarn install
40+
yarn ci
41+
- if: success()
42+
env:
43+
CI: true
44+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
run: npx semantic-release

.github/workflows/test.release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test Release
2+
3+
on: pull_request
4+
5+
jobs:
6+
tests:
7+
name: Test or Build
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Setup node
12+
uses: actions/setup-node@v2
13+
with:
14+
node-version: 12
15+
- name: Install dependencies
16+
env:
17+
CI: true
18+
run: |
19+
yarn install
20+
yarn ci
21+
- name: Build All Packages
22+
run: yarn run build
23+
24+
test_publish:
25+
needs: tests
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: actions/setup-node@v2
30+
with:
31+
node-version: 12
32+
- env:
33+
CI: true
34+
run: |
35+
yarn install
36+
yarn ci
37+
- env:
38+
CI: true
39+
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
40+
GITHUB_HEAD_REF: $GITHUB_HEAD_REF
41+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
42+
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
43+
run: |
44+
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > /home/runner/work/_temp/.npmrc
45+
npx semantic-release --dry-run --debug -b $GITHUB_HEAD_REF

.releaserc.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
branch: master
2+
ci: false
3+
dryRun: false
4+
debug: false
5+
extends: "semantic-release-npm-github-publish"

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
"description": "ReScript binding for React Chakra-UI.",
55
"author": "ri7nz <hi@rin.rocks>",
66
"license": "MIT",
7+
"homepage": "https://rescript-chakra.vercel.app/",
78
"repository": {
89
"type": "git",
910
"url": "https://github.com/ri7nz/rescript-chakra.git"
1011
},
1112
"bugs": "https://github.com/ri7nz/rescript-chakra/issues",
1213
"scripts": {
13-
"predocs": "yarn clean",
14-
"doc": "./node_modules/.bin/bsdoc",
15-
"docs": "yarn build && yarn doc build rescript-chakra",
16-
"start": "rescript build -w",
14+
"start": "rescript build -w -with-deps",
1715
"prebuild": "rescript clean",
1816
"build": "rescript build -with-deps",
19-
"clean": "rescript clean"
17+
"clean": "rescript clean",
18+
"semantic-release": "semantic-release",
19+
"ci": "yarn install --immutable"
2020
},
2121
"publishConfig": {
2222
"access": "public"
2323
},
2424
"devDependencies": {
2525
"@rescript/react": "0.10.3",
26-
"bsdoc": "6.0.4-alpha",
27-
"rescript": "9.1.3"
26+
"rescript": "9.1.3",
27+
"semantic-release": "17.4.4",
28+
"semantic-release-npm-github-publish": "1.4.0"
2829
},
2930
"peerDependencies": {
30-
"@rescript/react": "0.10.3",
31-
"react": ">=16.8.1",
32-
"react-dom": ">=16.8.1"
31+
"@chakra-ui/react": ">=1.6.3",
32+
"@rescript/react": "0.10.3"
3333
}
3434
}

0 commit comments

Comments
 (0)