Skip to content

Commit ad616b8

Browse files
authoredApr 24, 2021
Issue 12 ci manual release (#13)
* issue #12: updating automation * issue #12: ci fix * issue #12: fixing ci * updated changelog format * issue 12: prepare for CI * issue #12: preparations * fixing coverage fix * fixing code style issues * some * some
1 parent f46a71c commit ad616b8

25 files changed

+599
-402
lines changed
 

‎.github/workflows/quality.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ on:
88

99
jobs:
1010
quality_pipeline:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-18.04
1212

1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v2
16+
with:
17+
token: ${{ secrets.DTL_CI_AT }}
1618

1719
- name: Setup NodeJS 14
18-
uses: actions/setup-node@v1
20+
uses: actions/setup-node@v2
1921
with:
2022
node-version: 14
2123

‎.github/workflows/release-deploy.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy 'data-tier-list' to CDN
2+
3+
on:
4+
push:
5+
tags:
6+
- deploy
7+
8+
jobs:
9+
release-deploy:
10+
runs-on: ubuntu-18.04
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
token: ${{ secrets.DTL_CI_AT }}
17+
18+
- name: Delete temporary trigger tag
19+
run: git push origin --delete deploy
20+
21+
- name: Setup NodeJS 14
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: 14
25+
26+
- name: Install
27+
run: npm install
28+
29+
# Get release version
30+
- name: Get release version
31+
run: echo "RELEASE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
32+
33+
# Build
34+
- name: Build
35+
run: npm run build
36+
37+
# Deploy
38+
- name: Deploy
39+
env:
40+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS }}
41+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET }}
42+
run: aws s3 sync ./dist s3://${{ secrets.AWS_LIBS_BUCKET }}/data-tier-list/${{ env.RELEASE_VERSION }} --delete --cache-control public,max-age=172800,immutable

‎.github/workflows/release-prepare.yml

-71
This file was deleted.

‎.github/workflows/release-publish.yml

+29-8
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,50 @@ on:
77

88
jobs:
99
release:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-18.04
1111

1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v2
1515
with:
16-
token: ${{ secrets.CI_AT }}
16+
token: ${{ secrets.DTL_CI_AT }}
1717

1818
- name: Setup NodeJS 14
19-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v2
2020
with:
2121
node-version: 14
22+
registry-url: 'https://registry.npmjs.org'
2223

2324
- name: Install NPM
2425
run: npm install
2526

27+
# Prepare
2628
- name: Build
2729
run: npm run build
2830

31+
# Publish
2932
- name: Publish
30-
run: |
31-
echo registry=https://registry.npmjs.org/ > .npmrc
32-
echo //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN} >> .npmrc
33-
npm publish
3433
env:
35-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
35+
run: npm publish
36+
37+
# Deploy to CDN (trigger)
38+
- name: Tirgger deploy to CDN
39+
run: |
40+
git tag deploy
41+
git push origin HEAD:main deploy
42+
43+
# Bump version to next snapshot
44+
- name: Bump snapshot version
45+
run: |
46+
npm run bump -- --version=patch --snapshot
47+
npm install
48+
echo "SNAPSHOT_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
49+
- name: Push changes
50+
run: |
51+
git fetch
52+
git config user.email "gullerya@gmail.com"
53+
git config user.name "data-tier-list CI"
54+
git add --all
55+
git commit -m "set version to ${{ env.SNAPSHOT_VERSION }}"
56+
git push origin HEAD:main

‎.github/workflows/trigger-release.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Trigger 'data-tier-list' release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to bump to'
8+
required: false
9+
10+
jobs:
11+
prepare-verify-trigger:
12+
runs-on: ubuntu-18.04
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
with:
18+
token: ${{ secrets.DTL_CI_AT }}
19+
20+
- name: Setup NodeJS 14
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: 14
24+
25+
- name: Install NPM
26+
run: npm install
27+
28+
# Bump version
29+
- name: Bump to target version, if any
30+
if: ${{ github.event.inputs.version }}
31+
run: npm run bump -- --version=${{ github.event.inputs.version }}
32+
- name: Bump release version
33+
run: |
34+
npm run bump -- --release
35+
echo "RELEASE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
36+
37+
# Build & Verify new version
38+
- name: Build
39+
run: npm run build
40+
41+
- name: Lint
42+
run: npm run lint
43+
44+
- name: Test
45+
run: npm run test
46+
47+
# Push updated content to remote and Tag version
48+
- name: Push changes
49+
run: |
50+
git fetch
51+
git config user.email "gullerya@gmail.com"
52+
git config user.name "data-tier-list CI"
53+
git add --all
54+
git commit -m "update version to ${{ env.RELEASE_VERSION }}"
55+
git push origin HEAD:main
56+
57+
- name: Tag release
58+
run: |
59+
git tag -a v${{ env.RELEASE_VERSION }} -m "tag release v${{ env.RELEASE_VERSION }}"
60+
git push origin HEAD:main v${{ env.RELEASE_VERSION }}

‎.travis.yml

-16
This file was deleted.

‎ci/.eslintrc.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22
"extends": "eslint:recommended",
33
"env": {
44
"browser": true,
5+
"node": true,
56
"es2017": true
67
},
78
"parserOptions": {
8-
"ecmaVersion": 11,
9+
"ecmaVersion": 8,
910
"sourceType": "module"
1011
},
1112
"rules": {
12-
"no-shadow": [
13-
"error",
14-
{
15-
"builtinGlobals": true,
16-
"hoist": "all"
17-
}
18-
]
13+
"no-shadow": 2
1914
}
2015
}

0 commit comments

Comments
 (0)
Please sign in to comment.