Skip to content

Commit c20eaaa

Browse files
authored
chore(github): Set up release pipeline (#76)
1 parent 2ddadff commit c20eaaa

File tree

4 files changed

+3467
-112
lines changed

4 files changed

+3467
-112
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ on:
55
- master
66
pull_request:
77
jobs:
8-
Lint-Test:
8+
lint-test:
9+
name: "lint + test"
910
runs-on: macos-latest
11+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1012
steps:
1113
- name: Checkout
1214
uses: actions/checkout@v2
@@ -25,8 +27,10 @@ jobs:
2527
echo "::add-matcher::.github/eslint-stylish.json"
2628
yarn lint:js
2729
echo "::remove-matcher owner=eslint-stylish::"
28-
iOS:
30+
ios:
31+
name: "iOS"
2932
runs-on: macos-latest
33+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
3034
steps:
3135
- name: Checkout
3236
uses: actions/checkout@v2
@@ -45,8 +49,10 @@ jobs:
4549
run: |
4650
../scripts/xcodebuild-ios.sh ios/Example.xcworkspace test-without-building
4751
working-directory: example
48-
iOS-template:
52+
ios-template:
53+
name: "iOS [template: all]"
4954
runs-on: macos-latest
55+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
5056
steps:
5157
- name: Checkout
5258
uses: actions/checkout@v2
@@ -59,8 +65,10 @@ jobs:
5965
pod install --project-directory=ios
6066
../scripts/xcodebuild-ios.sh ios/TemplateExample.xcworkspace build
6167
working-directory: template-example
62-
iOS-template-exclusive:
68+
ios-template-exclusive:
69+
name: "iOS [template: ios]"
6370
runs-on: macos-latest
71+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
6472
steps:
6573
- name: Checkout
6674
uses: actions/checkout@v2
@@ -73,11 +81,13 @@ jobs:
7381
pod install
7482
../scripts/xcodebuild-ios.sh TemplateExample.xcworkspace build
7583
working-directory: template-example
76-
Android:
84+
android:
85+
name: "Android"
7786
strategy:
7887
matrix:
7988
os: [macos-latest, windows-latest]
8089
runs-on: ${{ matrix.os }}
90+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
8191
steps:
8292
- name: Checkout
8393
uses: actions/checkout@v2
@@ -105,11 +115,13 @@ jobs:
105115
pushd android 1> /dev/null
106116
./gradlew clean build check test
107117
working-directory: example
108-
Android-template:
118+
android-template:
119+
name: "Android [template: all]"
109120
strategy:
110121
matrix:
111122
os: [macos-latest, windows-latest]
112123
runs-on: ${{ matrix.os }}
124+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
113125
steps:
114126
- name: Checkout
115127
uses: actions/checkout@v2
@@ -136,11 +148,13 @@ jobs:
136148
./gradlew clean build check test
137149
shell: bash
138150
working-directory: template-example
139-
Android-template-exclusive:
151+
android-template-exclusive:
152+
name: "Android [template: android]"
140153
strategy:
141154
matrix:
142155
os: [macos-latest, windows-latest]
143156
runs-on: ${{ matrix.os }}
157+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
144158
steps:
145159
- name: Checkout
146160
uses: actions/checkout@v2
@@ -166,3 +180,31 @@ jobs:
166180
./gradlew clean build check test
167181
shell: bash
168182
working-directory: template-example
183+
release:
184+
needs:
185+
[
186+
lint-test,
187+
ios,
188+
ios-template,
189+
ios-template-exclusive,
190+
android,
191+
android-template,
192+
android-template-exclusive,
193+
]
194+
runs-on: macos-latest
195+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
196+
steps:
197+
- name: Checkout
198+
uses: actions/checkout@v2
199+
- name: Set up Node.js
200+
uses: actions/setup-node@v1
201+
with:
202+
node-version: 12
203+
- name: Install
204+
run: |
205+
yarn
206+
- name: Release
207+
env:
208+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
209+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
210+
run: npx semantic-release

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# React Native Test App
22

3+
![build](https://github.com/microsoft/react-native-test-app/workflows/build/badge.svg)
4+
[![npm version](https://badgen.net/npm/v/react-native-test-app)](https://www.npmjs.com/package/react-native-test-app)
5+
36
React Native Test App provides test apps for all platforms as a package.
47

58
This is a work in progress. You can read and discuss the RFC at
@@ -11,12 +14,11 @@ will write documentation when it becomes ready.
1114

1215
# Quick Start
1316

14-
Install `react-native-test-app` and `plop`. We will use Plop to generate the
15-
test app:
17+
Install `react-native-test-app` and `plop`. We will use
18+
[Plop](https://plopjs.com/) to generate the test app:
1619

1720
```bash
18-
yarn add react-native-test-app --dev
19-
yarn add plop --dev
21+
yarn add plop react-native-test-app --dev
2022
yarn plop --plopfile node_modules/react-native-test-app/plopfile.js --dest sample
2123
```
2224

package.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,31 @@
4040
"react-native": "0.60.6"
4141
},
4242
"devDependencies": {
43+
"@semantic-release/git": "^9.0.0",
4344
"eslint": "^6.8.0",
4445
"eslint-plugin-prettier": "^3.1.2",
4546
"plop": "^2.6.0",
46-
"prettier": "2.0.4"
47+
"prettier": "2.0.4",
48+
"semantic-release": "^17.0.0"
49+
},
50+
"release": {
51+
"tagFormat": "${version}",
52+
"plugins": [
53+
"@semantic-release/commit-analyzer",
54+
"@semantic-release/release-notes-generator",
55+
"@semantic-release/npm",
56+
"@semantic-release/github",
57+
[
58+
"@semantic-release/git",
59+
{
60+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
61+
"assets": [
62+
"example/ios/Podfile.lock",
63+
"example/yarn.lock",
64+
"package.json"
65+
]
66+
}
67+
]
68+
]
4769
}
4870
}

0 commit comments

Comments
 (0)