forked from eclipse-sirius/sirius-web
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.07 KB
/
build.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
name: Continuous integration
on:
push:
paths-ignore:
- 'doc/**'
branches:
- '**'
tags:
- '*'
pull_request:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node SDK
uses: actions/setup-node@v1.4.4
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install Yalc globally
run: npm i yalc -g
- name: Setup Java SDK
uses: actions/setup-java@v1.4.3
with:
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build the frontend
run: |
npm ci
npm run test
npm run-script format-lint
npm run build
yalc publish
working-directory: frontend
- name: Build the backend
env:
USERNAME: ${{github.actor}}
PASSWORD: ${{secrets.GITHUB_TOKEN}}
run: mvn -U -B -e clean verify -f backend/pom.xml --settings settings.xml
- name: Publish the backend
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: mvn -B -X deploy -f backend/pom.xml
- name: Publish the frontend
if: startsWith(github.ref, 'refs/tags/v')
run: |
npm publish
working-directory: frontend
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}