-
Notifications
You must be signed in to change notification settings - Fork 19
100 lines (93 loc) · 2.82 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
name: "Release"
on:
push:
tags:
- '**'
branches-ignore:
- "**"
jobs:
build:
runs-on: ubuntu-latest
env:
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version"
services:
mysql:
image: mariadb:10.1
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: 123456
options: >-
--health-cmd="mysqladmin ping"
--health-interval=5s
--health-timeout=2s
--health-retries=3
postgres:
image: postgres:9.6
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: 123456
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'adopt'
- name: Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Run Tests
run: mvn $MAVEN_CLI_OPTS -Dtestng.groups="travis-ci" test install
env:
DPT_MYSQL_USER: "root"
DPT_MYSQL_PASS: "123456"
DPT_MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
DPT_POSTGRESQL_USER: "postgres"
DPT_POSTGRESQL_PASS: "123456"
DPT_POSTGRESQL_PORT: ${{ job.services.postgres.ports[5432] }}
PGPASSWORD: '123456'
deploy:
needs: build
runs-on: ubuntu-latest
env:
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'adopt'
- name: Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Deploy to GitHub packages
run: mvn $MAVEN_CLI_OPTS clean package deploy -Dmaven.test.skip=true -Pdeploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get the version
run: echo "release_version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Upload DBPTK Developer to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dbptk-core/target/dbptk-app-${{ env.release_version }}.jar
asset_name: dbptk-app-${{ env.release_version }}.jar
tag: ${{ github.ref }}
release_name: Version ${{ env.release_version }}
draft: true