Skip to content

Commit

Permalink
ci: Setup semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbo2002 committed Feb 27, 2021
1 parent ccfa0f0 commit fc4a06f
Show file tree
Hide file tree
Showing 8 changed files with 15,104 additions and 108 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/**
dist/**
docs/**
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
push:
branches:
- main
- develop

jobs:
release:
runs-on: ubuntu-latest
if: contains(toJson(github.event.commits), '[skip ci]') == false
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run lint
- run: npm run test
- name: semantic-release
run: BRANCH=${GITHUB_REF#refs/heads/} npx semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.github
/.nyc_output
/.idea
/dist
/doc
/docs
/node_modules
2 changes: 1 addition & 1 deletion .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"coverage/**",
"node_modules/**"
],
"report-dir": "./doc/coverage/",
"report-dir": "./docs/coverage/",
"temp-directory": "./.nyc_output",
"sourceMap": true,
"reporter": [
Expand Down
15 changes: 11 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env bash
set -e

echo "########################"
echo "# build.sh"
echo "# Branch = ${BRANCH}"
echo "########################"

# Typescript Build in ./dist
npx tsc

if [ "$BRANCH" != "develop" ] && [ "$BRANCH" != "main" ] && [ "$BRANCH" != "" ]; then
Expand All @@ -13,12 +15,17 @@ if [ "$BRANCH" != "develop" ] && [ "$BRANCH" != "main" ] && [ "$BRANCH" != "" ];
fi;


rm -rf ./doc
mkdir -p ./docs/
rm -rf ./docs/coverage/ ./docs/reference/ ./docs/tests/


# TypeDoc in ./docs/referece
npx typedoc

# Test Report in ./docs/tests
npx mocha --reporter mochawesome
mv ./mochawesome-report/mochawesome.html ./mochawesome-report/index.html
mkdir -p ./doc
mv ./mochawesome-report ./doc/tests
mv -f ./mochawesome-report/mochawesome.html ./mochawesome-report/index.html
mv -f ./mochawesome-report ./docs/tests

# Coverage Report in ./doc/coverage
npm run coverage
Loading

0 comments on commit fc4a06f

Please sign in to comment.