-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (90 loc) · 2.7 KB
/
ci_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
name: CI Release
on:
push:
branches:
- main
jobs:
build_frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout frontend
uses: actions/[email protected]
with:
sparse-checkout: 'frontend'
- name: Install PNPM
uses: pnpm/[email protected]
with:
package_json_file: 'frontend/package.json'
- name: Setup node env
uses: actions/[email protected]
with:
cache: 'pnpm'
cache-dependency-path: 'frontend/pnpm-lock.yaml'
check-latest: true
node-version: 'lts/*'
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: 'frontend'
- name: Lint code
run: pnpm prepare && pnpm lint
working-directory: 'frontend'
- name: Build frontend
run: pnpm build
working-directory: 'frontend'
- name: Upload frontend artifact
uses: actions/[email protected]
with:
name: frontend-build
path: frontend/dist/spa/
build_backend:
needs: build_frontend
runs-on: ubuntu-latest
steps:
- name: Checkout backend
uses: actions/[email protected]
with:
sparse-checkout: 'backend'
- name: Setup java env
uses: actions/[email protected]
with:
cache: 'gradle'
distribution: 'temurin'
java-version: '21'
- name: Create needed folders for the frontend artifact
run: |
mkdir -p src/main/resources/static/
mkdir -p src/main/resources/templates/
working-directory: 'backend'
- name: Download frontend artifact
uses: actions/[email protected]
with:
name: frontend-build
path: backend/src/main/resources/static/
- name: Move index.html from static to templates
run: gradle bootJar
working-directory: 'backend'
- name: Upload backend artifact
uses: actions/[email protected]
with:
name: backend-build
path: backend/build/libs/openapi-catalog-*.jar
release:
needs: build_backend
runs-on: ubuntu-latest
steps:
- name: Download backend artifact
uses: actions/[email protected]
with:
name: backend-build
path: build/libs/
- name: Create release tag
run: |
TAG_NAME=${{ github.event.head_commit.timestamp }}
TAG_NAME=${TAG_NAME//:/-}
echo "TAG_NAME=${TAG_NAME}" >> "$GITHUB_ENV"
- name: Upload release
uses: softprops/action-gh-release@v2
with:
files: build/libs/
make_latest: true
tag_name: ${{ vars.TAG_NAME }}