-
Notifications
You must be signed in to change notification settings - Fork 26
82 lines (75 loc) · 2.53 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
81
82
name: Build
on:
push:
branches:
- '**'
# dependabot branches are built via pull request event
- '!dependabot/**'
jobs:
integration-tests:
name: Java ${{ matrix.java }}, MySQL ${{ matrix.mysql }}, MariaDB ${{ matrix.mariadb }}
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
java: [8, 11, 17]
mysql: [5.7, 8]
mariadb: [10]
steps:
- uses: actions/checkout@v4
- name: Install Perl modules
run: |
sudo apt-get update
sudo apt-get install libdbd-mysql-perl
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Run Integration Tests With Maven
shell: bash
run: |
./mvnw --batch-mode --errors --no-transfer-progress --show-version \
clean verify -Prun-its \
-Dmysql_image=mysql:${{ matrix.mysql }} \
-Dmariadb_image=mariadb:${{ matrix.mariadb }}
snapshot-deploy:
name: Deploy Snapshot to Sonatype
runs-on: ubuntu-latest
timeout-minutes: 60
if: ${{ github.repository == 'liquibase/liquibase-percona' && github.ref == 'refs/heads/main' }}
needs: integration-tests
steps:
- uses: actions/checkout@v4
- name: Install Perl modules
run: |
sudo apt-get update
sudo apt-get install libdbd-mysql-perl
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SECRET }}
gpg-passphrase: GPG_PASSPHRASE
- id: version
name: Determine Version from POM
shell: bash
run: |
VERSION="$(./mvnw -B -q org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -DforceStdout)"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Deploy Snapshot with Maven
if: ${{ contains(steps.version.outputs.version, 'SNAPSHOT') }}
run: |
./mvnw --batch-mode --errors --no-transfer-progress --show-version \
-Dmaven.test.skip -Dpmd.skip -Dcpd.skip -Dspotbugs.skip \
clean deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}