-
Notifications
You must be signed in to change notification settings - Fork 6
44 lines (41 loc) · 1.25 KB
/
test-and-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Test and Build
on:
push:
branches:
- 'master'
tags-ignore:
- 'v*' # version Tag push use release workflow
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Test and Build
run: npm run all
- name: Use Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup git
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
run: |
git config --local user.name GitHubActions
git remote set-url origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
- name: get version
id: get_version
run: |
echo ::set-output name=VERSION::$(git describe --tags $(git rev-list --tags --max-count=1))
- name: Git push, tag, upload assets
run: |
git checkout master
git pull origin master
git add -A
DIFF=`git diff --cached --numstat | wc -l`
if [ $DIFF -eq 0 ]; then
exit 0
fi
git commit -am 'GitHub Actions commit' --allow-empty
git push origin master