forked from finos/waltz
-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (91 loc) · 3.13 KB
/
maven.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
107
108
109
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Waltz Build (pg)
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_DB: waltz
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
- name: Update Maven Project Version
if: ${{ github.ref_type == 'tag' }}
run: mvn versions:set -DnewVersion=${{ github.ref_name }} -Pci,build-postgres,waltz-postgres;
- name: Build with Maven
run: mvn -Dmaven.test.failure.ignore=true -B -ntp -s .build.settings.xml -Pbuild-postgres,waltz-postgres,integration-tests clean package site;
- name: Publish build
uses: actions/upload-artifact@v4
with:
name: waltz-web-postgres.war
path: waltz-web/target/waltz-web.war
- name: Publish mocha results
uses: actions/upload-artifact@v4
with:
name: mocha-test-results.txt
path: waltz-ng/mocha-test-results.txt
- name: Publish liquibase changelogs
uses: actions/upload-artifact@v4
with:
name: liquibase-changelogs
path: waltz-schema/src/main/resources/liquibase/
- name: Publish Java Test results
uses: actions/upload-artifact@v4
with:
name: surefire-results.html
path: target/site/surefire-report.html
- name: Login to GitHub Registry
if: ${{ github.ref_type == 'tag' }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
flavor: latest=true
tags: |
type=ref,event=tag,enable=${{ github.ref_type == 'tag' }}
type=raw,value=postgres-${{ github.ref_name }},enable=${{ github.ref_type == 'tag' }}
type=raw,value=postgres
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.ref_type == 'tag' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ github.ref_type == 'tag' }}
with:
files: |
waltz-schema/target/liquibase-scripts.zip
waltz-web/target/waltz-web.war
waltz-web/target/waltz-web-jar-with-dependencies.jar