Skip to content

Commit 576950f

Browse files
authored
Merge pull request #46 from matrunchyk/ci_build
chore: Update CI/CD
2 parents deb080c + a499cb2 commit 576950f

File tree

12 files changed

+217
-73
lines changed

12 files changed

+217
-73
lines changed

.eslintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"rules": {
1414
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
1515
"@typescript-eslint/explicit-function-return-type": "off",
16+
"@typescript-eslint/explicit-module-boundary-types": "off",
17+
"@typescript-eslint/no-explicit-any": "off",
1618
"@typescript-eslint/ban-ts-comment": 0
1719
},
1820
"overrides": [

.github/labeler.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
documentation:
2+
- src/docs/*
3+
4+
graphql:
5+
- src/graphql/**/*
6+
7+
models:
8+
- src/models/**/*
9+
10+
repositories:
11+
- src/repositories/**/*
12+
13+
core:
14+
- src/*.ts
15+
16+
test:
17+
- test/**/*
18+
19+
repo:
20+
- .browserslistrc
21+
- .czrc
22+
- .editorconfig
23+
- .eslint*
24+
- .gitignore
25+
- .graphqlconfig
26+
- .npmrc
27+
- .snyk
28+
- .travis.yml
29+
- _config.yml
30+
- FUNDING.yml
31+
- CHANGELOG.md
32+
- commitlint.config.js
33+
- conventionalcommit.json
34+
- jest.config.json
35+
- dangerfile.ts
36+
- LICENSE
37+
- SECURITY.md
38+
- README.md
39+
- babel.config.js
40+
- nodemon.json
41+
- tsconfig.json
42+
- tsconfig.tsbuildinfo
43+
- .github/**/*
44+
45+
deps:
46+
- package.json
47+
- package-lock.json
48+
49+
#test:
50+
# - src/**/*.spec.js
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "CD: Tag"
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
create_tag:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout sources
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Bump version and push tag
18+
uses: mathieudutour/[email protected]
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
create_annotated_tag: true
22+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "CD: Publish"
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
continuous-deployment-build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout sources
12+
uses: actions/checkout@v2
13+
14+
- name: Setup Node.js environment
15+
uses: actions/[email protected]
16+
with:
17+
node-version: '12.x'
18+
registry-url: 'https://npm.pkg.github.com'
19+
20+
- name: Cache dependencies
21+
uses: actions/cache@v2
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-node-
27+
28+
- name: Install dependencies
29+
run: |
30+
npm ci
31+
32+
- name: Run tests
33+
run: npm run lint
34+
35+
- name: Compile a packages
36+
run: npm run build
37+
38+
# - name: Release the version
39+
# uses: fnkr/github-action-ghr@v1
40+
# if: startsWith(github.ref, 'refs/tags/')
41+
# env:
42+
# GHR_COMPRESS: xz
43+
# GHR_PATH: lib/
44+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
47+
publish-gpr:
48+
needs: [continuous-deployment-build]
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v2
52+
- uses: actions/[email protected]
53+
with:
54+
node-version: 12
55+
registry-url: https://npm.pkg.github.com/
56+
- run: npm ci
57+
- run: npm publish
58+
env:
59+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "CD: Release"
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
continuous-deployment-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout sources
13+
uses: actions/checkout@v2
14+
15+
- name: Create a release
16+
id: create_release
17+
uses: marvinpinto/action-automatic-releases@latest
18+
with:
19+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
20+
prerelease: false
21+
automatic_release_tag: latest
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Pull Request"
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
pull_request
7+
8+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
9+
jobs:
10+
# This workflow contains a single job called "continuous-integration"
11+
continuous-integration:
12+
# The type of runner that the job will run on
13+
runs-on: ubuntu-latest
14+
15+
# Steps represent a sequence of tasks that will be executed as part of the job
16+
steps:
17+
- name: Create PR labels
18+
uses: actions/labeler@v2
19+
with:
20+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
21+
22+
- name: Checkout sources
23+
uses: actions/checkout@v2
24+
25+
- name: Setup Node.js environment
26+
uses: actions/[email protected]
27+
with:
28+
node-version: '12.x'
29+
30+
- name: Cache dependencies
31+
uses: actions/cache@v2
32+
with:
33+
path: ~/.npm
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node-
37+
38+
- name: Install dependencies
39+
run: |
40+
npm install
41+
npm run lint
42+
npm run build

.npmrc

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

.release-it.json

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

.travis.yml

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

package.json

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-oop",
3-
"version": "1.6.3",
3+
"version": "1.6.4",
44
"description": "A library based on Model-Repository patterns for Vue components. Usable for GraphQL and REST APIs.",
55
"keywords": [
66
"collections",
@@ -41,10 +41,8 @@
4141
"dev": "tsc -w",
4242
"lint": "eslint '*/**/*.{ts,tsx}' --fix",
4343
"publish-github": "npm publish --registry https://npm.pkg.github.com/@matrunchyk",
44-
"release": "release-it",
4544
"test": "jest --config jest.config.json",
46-
"test:watch": "jest -w",
47-
"prepublishOnly": "npm run build"
45+
"test:watch": "jest -w"
4846
},
4947
"husky": {
5048
"hooks": {
@@ -55,7 +53,6 @@
5553
"apollo-boost": "^0.4.9",
5654
"apollo-cache-inmemory": "^1.6.6",
5755
"apollo-cache-instorage": "^0.2.5",
58-
"apollo-client": "^2.6.10",
5956
"apollo-link": "^1.2.14",
6057
"apollo-link-context": "^1.0.20",
6158
"apollo-link-http": "^1.5.17",
@@ -93,7 +90,6 @@
9390
"eslint": "^7.1.0",
9491
"husky": "^5.0.0",
9592
"jest": "^26.0.1",
96-
"release-it": "^13.6.8",
9793
"ts-jest": "^26.0.0",
9894
"ts-node": "^8.10.1",
9995
"tslib": "^2.0.0",
@@ -102,26 +98,14 @@
10298
},
10399
"peerDependencies": {
104100
"apollo-client": "^2.6.10",
105-
"vue": "^2.6.11"
101+
"vue": "^2.6.11 || >=3.0.0"
102+
},
103+
"peerDependenciesMeta": {
104+
"apollo-client": {
105+
"optional": true
106+
}
106107
},
107108
"publishConfig": {
108109
"access": "public"
109-
},
110-
"release-it": {
111-
"npm": {
112-
"publish": true
113-
},
114-
"github": {
115-
"release": true
116-
},
117-
"git": {
118-
"addUntrackedFiles": false
119-
},
120-
"plugins": {
121-
"@release-it/conventional-changelog": {
122-
"preset": "angular",
123-
"infile": "CHANGELOG.md"
124-
}
125-
}
126110
}
127111
}

0 commit comments

Comments
 (0)