Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 676f433

Browse files
committed
add github actions
1 parent 72f1366 commit 676f433

File tree

4 files changed

+161
-5
lines changed

4 files changed

+161
-5
lines changed

.github/workflows/bump-version.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Bump version
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
bump-version:
10+
name: 'Bump minor version'
11+
runs-on: ubuntu-20.04
12+
if: github.actor != 'osome-bot'
13+
14+
steps:
15+
- name: Load current commit
16+
uses: actions/checkout@v3
17+
with:
18+
token: ${{ secrets.OSOME_BOT_TOKEN }}
19+
20+
- uses: osomepteltd/actions/packages/bump-version@master
21+
with:
22+
token: ${{ secrets.OSOME_BOT_TOKEN }}

.github/workflows/default.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
setup:
13+
name: Set up
14+
runs-on: ubuntu-20.04
15+
16+
steps:
17+
- name: Cancel previous workflow runs
18+
uses: styfle/[email protected]
19+
with:
20+
access_token: ${{ github.token }}
21+
22+
- name: Load current commit
23+
uses: actions/checkout@v3
24+
with:
25+
ref: ${{ github.ref }}
26+
27+
- name: Read nvmrc
28+
id: read-nvmrc
29+
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
30+
shell: bash
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: ${{ steps.read-nvmrc.outputs.version }}
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
static-checks:
41+
name: Static checks
42+
needs: setup
43+
if: ${{ !contains(github.ref, 'refs/tags/') }}
44+
runs-on: ubuntu-20.04
45+
46+
steps:
47+
- name: Load current commit
48+
uses: actions/checkout@v3
49+
with:
50+
ref: ${{ github.ref }}
51+
52+
- name: Read nvmrc
53+
id: read-nvmrc
54+
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
55+
shell: bash
56+
57+
- name: Setup Node.js
58+
uses: actions/setup-node@v3
59+
with:
60+
node-version: ${{ steps.read-nvmrc.outputs.version }}
61+
62+
- name: Install dependencies and check package-lock.json
63+
run: |
64+
cp package-lock.json package-lock.json.orig
65+
npm install
66+
if ! diff --color=always package-lock.json.orig package-lock.json ; then
67+
echo "package-lock.json changed, failing build"
68+
exit 1
69+
fi
70+
71+
- name: Linter
72+
run: npm run lint
73+
74+
tests:
75+
name: Unit tests
76+
needs: setup
77+
if: ${{ !contains(github.ref, 'refs/tags/') }}
78+
runs-on: ubuntu-20.04
79+
80+
steps:
81+
- name: Load current commit
82+
uses: actions/checkout@v3
83+
with:
84+
ref: ${{ github.ref }}
85+
86+
- name: Read nvmrc
87+
id: read-nvmrc
88+
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
89+
shell: bash
90+
91+
- name: Setup Node.js
92+
uses: actions/setup-node@v3
93+
with:
94+
node-version: ${{ steps.read-nvmrc.outputs.version }}
95+
96+
- name: Install dependencies
97+
run: npm ci
98+
99+
- name: Run unit tests and check coverage
100+
run: npm run test
101+
102+
publish:
103+
name: Publish package
104+
needs:
105+
- setup
106+
runs-on: ubuntu-20.04
107+
if: contains(github.ref, 'refs/tags/')
108+
109+
steps:
110+
- name: Load current commit
111+
uses: actions/checkout@v3
112+
with:
113+
ref: ${{ github.ref }}
114+
115+
- name: Read nvmrc
116+
id: read-nvmrc
117+
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
118+
shell: bash
119+
120+
- name: Setup Node.js
121+
uses: actions/setup-node@v3
122+
with:
123+
node-version: ${{ steps.read-nvmrc.outputs.version }}
124+
125+
- name: Install dependencies
126+
run: npm ci
127+
128+
- name: Setup Node.js
129+
uses: actions/setup-node@v3
130+
with:
131+
node-version: ${{ steps.read-nvmrc.outputs.version }}
132+
registry-url: 'https://npm.pkg.github.com'
133+
134+
- name: Publish package
135+
run: npm publish
136+
env:
137+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"repository": {
1212
"type": "git",
13-
"url": "git+https://github.com/Ajaxy/sequelize-serialize.git"
13+
"url": "git+https://github.com/OsomePteLtd/sequelize-serialize.git"
1414
},
1515
"keywords": [
1616
"sequelize",
@@ -27,10 +27,6 @@
2727
],
2828
"author": "Alexander Zinchuk ([email protected])",
2929
"license": "MIT",
30-
"bugs": {
31-
"url": "https://github.com/Ajaxy/sequelize-serialize/issues"
32-
},
33-
"homepage": "https://github.com/Ajaxy/sequelize-serialize#readme",
3430
"devDependencies": {
3531
"eslint": "^5.4.0",
3632
"eslint-config-airbnb-base": "^13.1.0",

0 commit comments

Comments
 (0)