Skip to content

Commit 1958105

Browse files
committed
chore: testing ci process (#4)
1 parent 8cceea8 commit 1958105

File tree

3 files changed

+47
-32
lines changed

3 files changed

+47
-32
lines changed

.github/workflows/ci.yml

-27
This file was deleted.

.github/workflows/main.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
install-build-and-test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Install dependencies
14+
run: |
15+
npm install
16+
npm install react
17+
- name: Build package
18+
run: npm run build
19+
- name: Run tests
20+
run: npm run test
21+
- name: Prepare new release
22+
run: |
23+
git config --global user.email "[email protected]"
24+
git config --global user.name "GitHub Actions"
25+
git remote set-url origin https://github.com/cchanxzy:${GITHUB_TOKEN}/React-Currency-Input-Field.git
26+
npm run release
27+
git push --follow-tags origin HEAD
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
release:
31+
needs: install-build-and-test
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v1
35+
- uses: actions/setup-node@v1
36+
with:
37+
node-version: 12
38+
registry-url: https://registry.npmjs.org/
39+
- name: Publish to NPM
40+
run: npm publish
41+
env:
42+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/pr.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ name: PR
33
on: [pull_request]
44

55
jobs:
6-
build:
6+
install-build-and-test:
77
runs-on: ubuntu-latest
88

99
steps:
1010
- uses: actions/checkout@v1
11-
- name: Dependencies
11+
- name: Install dependencies
1212
run: |
1313
npm install
1414
npm install react
15-
- name: Test
16-
run: npm run test
17-
- name: Build
15+
- name: Build package
1816
run: npm run build
17+
- name: Run tests
18+
run: npm run test

0 commit comments

Comments
 (0)