Skip to content
This repository was archived by the owner on Mar 28, 2022. It is now read-only.

Commit a8f692d

Browse files
authored
Merge pull request #92 from mocks-server/release
Release v2.0.5
2 parents 848b6b6 + 45e1808 commit a8f692d

File tree

10 files changed

+167
-66
lines changed

10 files changed

+167
-66
lines changed

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release
7+
pull_request:
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node: ["12.19.0", "14.15.0", "15.2.0"]
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Extract branch name
18+
shell: bash
19+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
20+
id: extract-branch
21+
- name: Use Node.js
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node }}
25+
- name: Cache node modules
26+
uses: actions/cache@v2
27+
env:
28+
cache-name: cache-node-modules
29+
with:
30+
# npm cache files are stored in `~/.npm` on Linux/macOS
31+
path: ~/.npm
32+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-build-${{ env.cache-name }}-
35+
${{ runner.os }}-build-
36+
${{ runner.os }}-
37+
- name: Install dependencies
38+
run: npm ci
39+
- name: Lint
40+
run: npm run lint
41+
- name: Test unit
42+
run: npm run test:unit
43+
- name: Upload test results
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: coverage-${{ matrix.node }}
47+
path: coverage
48+
retention-days: 1
49+
quality:
50+
runs-on: ubuntu-latest
51+
needs: test
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v2
55+
- name: Download test results
56+
uses: actions/download-artifact@v2
57+
with:
58+
name: coverage-15.2.0
59+
path: coverage
60+
- name: Coveralls
61+
uses: coverallsapp/github-action@master
62+
with:
63+
github-token: ${{ secrets.GITHUB_TOKEN }}
64+
- name: SonarCloud Scan
65+
if: env.SONAR_TOKEN != ''
66+
uses: sonarsource/sonarcloud-github-action@master
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: check-package-version
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
jobs:
7+
check-package-version:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Get NPM version is new
13+
id: check
14+
uses: EndBug/version-check@v1.6.0
15+
with:
16+
diff-search: true
17+
file-name: ./package.json
18+
file-url: https://unpkg.com/@mocks-server/admin-api-client@latest/package.json
19+
static-checking: localIsNew
20+
- name: Check version is new
21+
if: steps.check.outputs.changed != 'true'
22+
run: |
23+
echo "Version not changed"
24+
exit 1
25+
- name: Get NPM version
26+
id: package-version
27+
uses: martinbeentjes/npm-get-version-action@v1.1.0
28+
- name: Check Changelog version
29+
id: changelog_reader
30+
uses: mindsers/changelog-reader-action@v2.0.0
31+
with:
32+
version: ${{ steps.package-version.outputs.current-version }}
33+
path: ./CHANGELOG.md
34+
- name: Read version from Sonar config
35+
id: sonar-version
36+
uses: christian-draeger/read-properties@1.0.1
37+
with:
38+
path: './sonar-project.properties'
39+
property: 'sonar.projectVersion'
40+
- name: Check Sonar version
41+
if: steps.sonar-version.outputs.value != steps.package-version.outputs.current-version
42+
run: |
43+
echo "Version not changed"
44+
exit 1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: publish-to-github
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- run: npm ci
11+
- run: npm run build
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: '12.x'
15+
registry-url: 'https://npm.pkg.github.com'
16+
# Defaults to the user or organization that owns the workflow file
17+
scope: '@mocks-server'
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-to-npm.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: publish-to-npm
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-node@v1
11+
with:
12+
node-version: '12.x'
13+
registry-url: 'https://registry.npmjs.org/'
14+
- run: npm ci
15+
- run: npm run build
16+
- run: npm publish
17+
env:
18+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Fixed
1111
### Removed
1212

13+
## [2.0.5] - 2020-12-21
14+
15+
### Added
16+
- chore(deps): Add support for Node.js v15.x
17+
18+
### Changed
19+
- chore(ci): Migrate from Travis CI to github actions
20+
1321
## [2.0.4] - 2020-10-27
1422
### Changed
1523
- Update dependencies

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build status][travisci-image]][travisci-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url]
1+
[![Build status][build-image]][build-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url]
22

33
[![NPM dependencies][npm-dependencies-image]][npm-dependencies-url] [![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com) [![Last commit][last-commit-image]][last-commit-url] [![Last release][release-image]][release-url]
44

@@ -84,8 +84,8 @@ Please read the [contributing guidelines](.github/CONTRIBUTING.md) and [code of
8484

8585
[coveralls-image]: https://coveralls.io/repos/github/mocks-server/admin-api-client/badge.svg
8686
[coveralls-url]: https://coveralls.io/github/mocks-server/admin-api-client
87-
[travisci-image]: https://travis-ci.com/mocks-server/admin-api-client.svg?branch=master
88-
[travisci-url]: https://travis-ci.com/mocks-server/admin-api-client
87+
[build-image]: https://github.com/mocks-server/admin-api-client/workflows/build/badge.svg?branch=master
88+
[build-url]: https://github.com/mocks-server/admin-api-client/actions?query=workflow%3Abuild+branch%3Amaster
8989
[last-commit-image]: https://img.shields.io/github/last-commit/mocks-server/admin-api-client.svg
9090
[last-commit-url]: https://github.com/mocks-server/admin-api-client/commits
9191
[license-image]: https://img.shields.io/npm/l/@mocks-server/admin-api-client.svg

package-lock.json

Lines changed: 1 addition & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mocks-server/admin-api-client",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"description": "Client of @mocks-server/plugin-admin-api",
55
"keywords": [
66
"mocks-server-plugin",
@@ -29,9 +29,7 @@
2929
"mocks:install": "cd mocks && npm i",
3030
"mocks:ci": "cd mocks && npm run mocks:ci",
3131
"test": "jest",
32-
"test:coverage": "npm run mocks:install && start-server-and-test mocks:ci tcp:3200 test",
33-
"coveralls": "cat ./coverage/lcov.info | coveralls",
34-
"test:ci": "npm run test:coverage"
32+
"test:unit": "npm run mocks:install && start-server-and-test mocks:ci tcp:3200 test"
3533
},
3634
"dependencies": {
3735
"cross-fetch": "3.0.6",
@@ -45,7 +43,6 @@
4543
"babel-eslint": "10.1.0",
4644
"babel-jest": "26.6.1",
4745
"babel-polyfill": "6.26.0",
48-
"coveralls": "3.0.9",
4946
"eslint": "7.12.1",
5047
"eslint-config-prettier": "6.15.0",
5148
"eslint-plugin-prettier": "3.1.4",
@@ -71,6 +68,6 @@
7168
}
7269
},
7370
"engines": {
74-
"node": "12.x || 14.x"
71+
"node": "12.x || 14.x || 15.x"
7572
}
7673
}

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sonar.organization=mocks-server
22
sonar.projectKey=mocks-server-admin-api-client
3-
sonar.projectVersion=2.0.4
3+
sonar.projectVersion=2.0.5
44

55
sonar.javascript.file.suffixes=.js
66
sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)