Skip to content

Commit 408e843

Browse files
committed
add maven build
1 parent df88397 commit 408e843

11 files changed

Lines changed: 451 additions & 225 deletions

File tree

.github/workflows/main-5.4.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 136 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,143 @@
1-
# This workflow will build a Java project with Ant
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant
1+
name: Java CI Combined
32

4-
name: Java CI - Lucee 6
5-
6-
on:
7-
push:
8-
branches:
9-
- '**' # thus ignoring tagging
10-
pull_request:
11-
workflow_dispatch:
3+
on: [push, pull_request, workflow_dispatch]
124

135
jobs:
14-
build:
6+
setup:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
version: ${{ steps.extract-version.outputs.VERSION }}
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up JDK 11
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: 'temurin'
18+
java-version: '11'
19+
- name: Cache Maven packages
20+
uses: actions/cache@v3
21+
with:
22+
path: ~/.m2
23+
key: lucee-script-runner-maven-cache
24+
- name: Cache Maven packages
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.m2
28+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
29+
restore-keys: |
30+
${{ runner.os }}-maven-
31+
32+
- name: Extract version number
33+
id: extract-version
34+
run: |
35+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
36+
echo "::set-output name=VERSION::$VERSION"
1537
38+
- name: Cache Lucee files
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache
42+
key: lucee-downloads
43+
44+
- name: Import GPG key
45+
run: |
46+
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
47+
env:
48+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
49+
50+
build-and-test:
1651
runs-on: ubuntu-latest
52+
needs: setup
1753
env:
18-
luceeVersion: light-6.0.0.451-BETA
19-
luceeVersionQuery: 0/all/light
54+
testLabels: pdf
55+
testAdditional: ${{ github.workspace }}/tests
56+
LUCEE_TEST_VERSIONS: ${{ vars.LUCEE_TEST_VERSIONS }}
57+
strategy:
58+
matrix:
59+
lucee: ${{ fromJSON(vars.LUCEE_TEST_VERSIONS) }}
60+
services:
61+
minio:
62+
image: fclairamb/minio-github-actions
63+
ports:
64+
- 9000:9000
2065
steps:
21-
- uses: actions/checkout@v3
22-
- name: Set up JDK 11
23-
uses: actions/setup-java@v3
24-
with:
25-
java-version: '11'
26-
distribution: 'temurin'
27-
- name: Cache Maven packages
28-
uses: actions/cache@v3
29-
with:
30-
path: ~/.m2
31-
key: lucee-script-runner-maven-cache
32-
- name: Cache Lucee files
33-
uses: actions/cache@v3
34-
with:
35-
path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache
36-
key: lucee-downloads
37-
- name: Build with Ant
38-
run: ant -noinput -verbose -buildfile build.xml
39-
- name: Upload Artifact
40-
uses: actions/upload-artifact@v3
41-
with:
42-
name: pdf-lex
43-
path: dist/*.lex
44-
- name: Checkout Lucee
45-
uses: actions/checkout@v3
46-
with:
47-
repository: lucee/lucee
48-
path: lucee
49-
- name: Run Lucee Test Suite
50-
uses: lucee/script-runner@main
51-
with:
52-
webroot: ${{ github.workspace }}/lucee/test
53-
execute: /bootstrap-tests.cfm
54-
luceeVersion: ${{ env.luceeVersion }}
55-
luceeVersionQuery: ${{ env.luceeVersionQuery }}
56-
extensionDir: ${{ github.workspace }}/dist
57-
extensions: B737ABC4-D43F-4D91-8E8E973E37C40D1B # image-ext for tests
58-
env:
59-
testLabels: pdf
60-
testAdditional: ${{ github.workspace }}/tests
66+
- uses: actions/checkout@v4
67+
68+
- name: Set up JDK 11
69+
uses: actions/setup-java@v4
70+
with:
71+
java-version: '11'
72+
distribution: 'adopt'
73+
74+
- name: Build and Install with Maven
75+
run: |
76+
echo "------- Maven Install -------";
77+
mvn -B -e -f pom.xml clean install
78+
79+
- name: Upload Artifact
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: pdf-lex-${{ matrix.lucee.version }}
83+
path: target/*.lex
84+
85+
- name: Checkout Lucee
86+
uses: actions/checkout@v4
87+
with:
88+
repository: lucee/lucee
89+
path: lucee
90+
91+
- name: Run Lucee Test Suite
92+
uses: lucee/script-runner@main
93+
with:
94+
webroot: ${{ github.workspace }}/lucee/test
95+
execute: /bootstrap-tests.cfm
96+
luceeVersion: ${{ matrix.lucee.version }}
97+
luceeVersionQuery: ${{ matrix.lucee.query }}
98+
extensionDir: ${{ github.workspace }}/target
99+
env:
100+
testLabels: pdf
101+
testAdditional: ${{ github.workspace }}/tests
102+
103+
deploy:
104+
runs-on: ubuntu-latest
105+
needs: [build-and-test]
106+
if: always() && needs.build-and-test.result == 'success'
107+
steps:
108+
- name: Checkout repository
109+
uses: actions/checkout@v4
110+
111+
- name: Set up JDK 11
112+
uses: actions/setup-java@v4
113+
with:
114+
distribution: 'temurin'
115+
java-version: '11'
116+
117+
- name: Cache Maven packages
118+
uses: actions/cache@v4
119+
with:
120+
path: ~/.m2
121+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
122+
restore-keys: |
123+
${{ runner.os }}-maven-
124+
125+
- name: Import GPG key
126+
run: |
127+
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
128+
env:
129+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
130+
131+
- name: Build and Deploy with Maven
132+
env:
133+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
134+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
135+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
136+
run: |
137+
if [[ "${{ needs.setup.outputs.version }}" == *-SNAPSHOT ]]; then
138+
echo "------- Maven Deploy snapshot on ${{ github.event_name }} -------";
139+
mvn -B -e -f pom.xml clean deploy --settings maven-settings.xml
140+
else
141+
echo "------- Maven Deploy release on ${{ github.event_name }} -------";
142+
mvn -B -e -f pom.xml clean deploy -DperformRelease=true --settings maven-settings.xml
143+
fi

build.number

Lines changed: 0 additions & 3 deletions
This file was deleted.

build.properties

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)