-
Notifications
You must be signed in to change notification settings - Fork 46
106 lines (106 loc) · 3.54 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release
on:
push:
tags:
- v*
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
RUNNER: github
NODE_ENV: test
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Setup node.js environment
uses: actions/setup-node@v4
with:
node-version: '18.19.0'
- name: Create directories
run: mkdir -p ./dist/env && cp ./src/env/template.env ./dist/env/test.env
- name: Setup .env file
run: |
echo FACEBOOK_CONSUMER_ID = "${{ secrets.FACEBOOK_CONSUMER_ID }}" >> ./dist/env/test.env
echo FACEBOOK_CONSUMER_SECRET = "${{ secrets.FACEBOOK_CONSUMER_SECRET }}" >> ./dist/env/test.env
echo GITHUB_CONSUMER_ID = "${{ secrets.GTHB_CONSUMER_ID }}" >> ./dist/env/test.env
echo GITHUB_CONSUMER_SECRET = "${{ secrets.GTHB_CONSUMER_SECRET }}" >> ./dist/env/test.env
echo GOOGLE_CONSUMER_ID = "${{ secrets.GOOGLE_CONSUMER_ID }}" >> ./dist/env/test.env
echo GOOGLE_CONSUMER_SECRET = "${{ secrets.GOOGLE_CONSUMER_SECRET }}" >> ./dist/env/test.env
echo LINKEDIN_CONSUMER_ID = "${{ secrets.LINKEDIN_CONSUMER_ID }}" >> ./dist/env/test.env
echo LINKEDIN_CONSUMER_SECRET = "${{ secrets.LINKEDIN_CONSUMER_SECRET }}" >> ./dist/env/test.env
- name: Install global dependencies
run: npm i typescript@5.3.3 -g && npm i typeorm@0.2.41 -g
- name: Install local dependencies
run: npm i
- name: Compile Typescript files
run: tsc
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-files
path: |
dist
retention-days: 3
test:
name: Test
runs-on: ubuntu-latest
needs: [ build ]
env:
RUNNER: github
NODE_ENV: test
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Setup node.js environment
uses: actions/setup-node@v4
with:
node-version: '18.19.0'
- name: Setup MySQL server
uses: mirromutth/mysql-action@v1.1
with:
mysql version: '5.7'
mysql database: 'typeplate_test'
mysql root password: passw0rd
- name: Install global dependencies
run: npm i typescript@5.3.3 -g && npm i typeorm@0.2.41 -g
- name: Install local dependencies
run: npm i
- name: Create dist directory
run: mkdir dist
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-files
path: dist
- name: Synchronize database schema
run: typeorm schema:sync
- name: Execute tests suites
run: npm run ci:test
- name: Publish to coveralls.io
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./reports/coverage/lcov.info
release:
name: Release on Github
runs-on: ubuntu-latest
needs: [ build, test ]
steps:
- name: Cache dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: node-modules-${{ hashfiles('**/package-lock.json') }}
- name: Github checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node.js environment
uses: actions/setup-node@v4
with:
node-version: '16.19.0'
- name: Create release
uses: konfer-be/action-create-release-from-tag@v1.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}