-
-
Notifications
You must be signed in to change notification settings - Fork 29
131 lines (126 loc) · 3.99 KB
/
continuous-integration.yaml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Continuous Integration
on: [ push, pull_request ]
jobs:
Build:
name: "Build"
runs-on: ubuntu-22.04
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup node"
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: "Install system dependencies"
run: sudo apt install graphviz zip
- name: "Cache Node.js modules"
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node18-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node18-
${{ runner.OS }}-
- name: "Install dependencies"
run: npm ci --no-progress
- name: "Lint"
run: npm run lint
- name: "Test"
run: npm test
- name: "Create .cache directory"
run: mkdir -p .cache
- name: "Create tmorin-plantuml-libs.zip"
run: zip -r ../.cache/tmorin-plantuml-libs.zip *
working-directory: distribution
- name: "Upload tmorin-plantuml-libs.zip"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
.cache/tmorin-plantuml-libs.zip
GithubRelease:
name: "Github Release"
runs-on: ubuntu-22.04
needs: [ Build ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Download all artifacts"
uses: actions/download-artifact@v3
- name: "Create the release"
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "artifacts/tmorin-plantuml-libs.zip"
omitName: true
omitBody: true
draft: false
token: ${{ secrets.GITHUB_TOKEN }}
GithubPages:
name: "Github Pages"
runs-on: ubuntu-22.04
needs: [ Build ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup Node"
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: "Cache Node.js modules"
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node18-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node18-
${{ runner.OS }}-
- name: "Install dependencies"
run: npm ci --no-progress
- name: "Build summary"
run: npm run generate:website -- --gTagId ${{ secrets.GOOGLE_TAG_ID }}
- name: "Create tmorin-plantuml-public.zip"
run: zip -r ../tmorin-plantuml-public.zip *
working-directory: public
- name: "Upload tmorin-plantuml-public.zip"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
tmorin-plantuml-public.zip
- name: "Publish Github Pages"
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
NpmPublication:
name: "NPM Publication"
runs-on: ubuntu-22.04
needs: [ Build ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup node"
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: '@tmorin'
- name: "Install system dependencies"
run: sudo apt install graphviz zip
- name: "Cache Node.js modules"
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node18-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node18-
${{ runner.OS }}-
- name: "Install dependencies"
run: npm ci --no-progress
- name: "Publish package"
run: npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}