Skip to content

Commit 465403c

Browse files
committed
feat: publish with github actions
1 parent b8cce3c commit 465403c

5 files changed

Lines changed: 148 additions & 2 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Go to '...'
13+
2. Click on '....'
14+
3. Scroll down to '....'
15+
4. See error
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Screenshots**
21+
If applicable, add screenshots to help explain your problem.
22+
23+
**Desktop (please complete the following information):**
24+
- OS: [e.g. iOS]
25+
- Browser [e.g. chrome, safari]
26+
- Version [e.g. 22]
27+
28+
**Smartphone (please complete the following information):**
29+
- Device: [e.g. iPhone6]
30+
- OS: [e.g. iOS8.1]
31+
- Browser [e.g. stock browser, safari]
32+
- Version [e.g. 22]
33+
34+
**Additional context**
35+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.github/workflows/integration.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Integration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
12+
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
13+
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v2
17+
18+
- name: Init
19+
run: make github-init
20+
21+
- name: Lint
22+
run: make lint
23+
24+
- name: Test
25+
run: make test
26+
env:
27+
RINKEBY_PRIVATE_KEY: ${{ secrets.RINKEBY_PRIVATE_KEY }}

.github/workflows/publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: publish
2+
env:
3+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
4+
on:
5+
push:
6+
branches:
7+
- master
8+
jobs:
9+
packages:
10+
runs-on: ubuntu-latest
11+
if: "! contains(github.event.head_commit.message, '[skip ci]')"
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
ref: master
18+
token: ${{ secrets.GIT_HUB_TOKEN }}
19+
20+
- name: Use Node.js v16
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: 16
24+
25+
- name: Install dependencies
26+
run: |
27+
make github-init
28+
git checkout .
29+
30+
- name: Extract current version
31+
id: get_version
32+
run: |
33+
CURRENT_VERSION=$(cat version | awk '{$1=$1;print}')
34+
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
35+
36+
- name: Config Git
37+
run: |
38+
git config --local user.name "bot"
39+
git config --local user.email "bot@arcblock.io"
40+
41+
- name: Build packages
42+
run: |
43+
make build
44+
45+
- name: Publish to NPM
46+
run: |
47+
npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"
48+
echo "publish version ${CURRENT_VERSION}"
49+
lerna version ${CURRENT_VERSION} --exact --no-push --force-publish --yes
50+
lerna publish from-git --yes
51+
52+
- name: Update Docs
53+
run: |
54+
node tools/update-readme.js
55+
git add README.md
56+
git commit -m '[skip ci] update readme'
57+
58+
- name: Push Readme
59+
uses: ad-m/github-push-action@master
60+
with:
61+
github_token: ${{ secrets.GIT_HUB_TOKEN }}
62+
branch: ${{ github.ref }}
63+
64+
- name: Post publish
65+
run: node tools/post-publish.js
66+
env:
67+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ build:
1010
init: install dep
1111
@echo "Initializing the repo..."
1212

13-
travis-init: install dep
14-
@echo "Initialize software required for travis (normally ubuntu software)"
13+
github-init: install dep
14+
@echo "Initialize software required for github (normally ubuntu software)"
1515

1616
install:
1717
@echo "Install software required for this repo..."

0 commit comments

Comments
 (0)