Skip to content
This repository has been archived by the owner. It is now read-only.

Commit 58d926a

Browse files
authored
ci: Set up semantic-release (#10)
1 parent ec25e28 commit 58d926a

File tree

3 files changed

+4638
-171
lines changed

3 files changed

+4638
-171
lines changed

.github/workflows/nodejs.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,38 @@ on:
55
- master
66
pull_request:
77
jobs:
8-
build:
8+
test:
99
strategy:
1010
matrix:
11-
node-version: [10.x, 12.x]
11+
node-version: [10.x, 12.x, 14.x]
1212
runs-on: ubuntu-latest
13+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1314
steps:
1415
- name: Checkout
1516
uses: actions/checkout@v1
16-
- name: Use Node.js ${{ matrix.node-version }}
17+
- name: Set up Node.js ${{ matrix.node-version }}
1718
uses: actions/setup-node@v1
1819
with:
1920
node-version: ${{ matrix.node-version }}
20-
- name: yarn install, build, and test
21+
- name: Install
22+
run: yarn ci
23+
- name: Test
24+
run: yarn test
25+
release:
26+
needs: [test]
27+
runs-on: ubuntu-latest
28+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
29+
steps:
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v1
32+
with:
33+
node-version: 14
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
- name: Install
37+
run: yarn ci
38+
- name: Release
2139
env:
22-
CI: true
23-
run: |
24-
yarn
25-
yarn ci:test
40+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
run: npx semantic-release

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
"url": "git+https://github.com/microsoft/react-native-lazy-index.git"
2727
},
2828
"scripts": {
29-
"ci:test": "yarn format && yarn codegen && git diff && test $(git diff | grep -c '$') -eq 0",
29+
"ci": "yarn --frozen-lockfile --non-interactive",
3030
"codegen": "babel --plugins codegen index.js > index.js.out",
31-
"format": "prettier --write $(git ls-files '*.js' '*.json')"
31+
"format": "prettier --write $(git ls-files '*.js' '*.json')",
32+
"test": "yarn format && yarn codegen && git diff && test $(git diff | grep -c '$') -eq 0"
3233
},
3334
"dependencies": {
3435
"@babel/core": "^7.0.0-0",
@@ -39,12 +40,16 @@
3940
},
4041
"devDependencies": {
4142
"@babel/cli": "^7.0.0",
42-
"prettier": "2.0.5"
43+
"prettier": "^2.0.0",
44+
"semantic-release": "^17.0.0"
4345
},
4446
"experiences": {
4547
"FeatureA": "@contoso/feature-a",
4648
"FeatureB": "@contoso/feature-b",
4749
"FeatureC": "@contoso/feature-c",
4850
"FeatureD": "@contoso/feature-d"
51+
},
52+
"release": {
53+
"tagFormat": "${version}"
4954
}
5055
}

0 commit comments

Comments
 (0)