Skip to content

Commit 77fbf0e

Browse files
committed
add maven build
1 parent 68e8267 commit 77fbf0e

7 files changed

Lines changed: 430 additions & 48 deletions

File tree

.github/workflows/main.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Java CI Combined
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
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+
20+
- name: Cache Maven packages
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.m2
24+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: |
26+
${{ runner.os }}-maven-
27+
28+
- name: Extract version number
29+
id: extract-version
30+
run: |
31+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
32+
echo "::set-output name=VERSION::$VERSION"
33+
34+
- name: Cache Lucee files
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache
38+
key: lucee-downloads
39+
40+
- name: Import GPG key
41+
run: |
42+
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
43+
env:
44+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
45+
46+
build-and-test:
47+
runs-on: ubuntu-latest
48+
needs: setup
49+
env:
50+
LUCEE_TEST_VERSIONS_JAKARTA: ${{ vars.LUCEE_TEST_VERSIONS_JAKARTA }}
51+
strategy:
52+
matrix:
53+
lucee: ${{ fromJSON(vars.LUCEE_TEST_VERSIONS_JAKARTA) }}
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Set up JDK 11
58+
uses: actions/setup-java@v4
59+
with:
60+
java-version: '11'
61+
distribution: 'adopt'
62+
63+
- name: Build and Install with Maven
64+
run: |
65+
echo "------- Maven Install -------";
66+
mvn -B -e -f pom.xml clean install
67+
68+
- name: Upload Artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: tasks-lex-${{ matrix.lucee.version }}
72+
path: target/*.lex
73+
74+
- name: Checkout Lucee
75+
uses: actions/checkout@v4
76+
with:
77+
repository: lucee/lucee
78+
path: lucee
79+
80+
- name: Run Lucee Test Suite
81+
uses: lucee/script-runner@main
82+
with:
83+
webroot: ${{ github.workspace }}/lucee/test
84+
execute: /bootstrap-tests.cfm
85+
luceeVersion: ${{ matrix.lucee.version }}
86+
luceeVersionQuery: ${{ matrix.lucee.query }}
87+
extensionDir: ${{ github.workspace }}/target
88+
env:
89+
testLabels: tasks
90+
testAdditional: ${{ github.workspace }}/tests
91+
92+
deploy:
93+
runs-on: ubuntu-latest
94+
needs: [build-and-test]
95+
if: always() && needs.build-and-test.result == 'success'
96+
steps:
97+
- name: Checkout repository
98+
uses: actions/checkout@v4
99+
100+
- name: Set up JDK 11
101+
uses: actions/setup-java@v4
102+
with:
103+
distribution: 'temurin'
104+
java-version: '11'
105+
106+
- name: Cache Maven packages
107+
uses: actions/cache@v4
108+
with:
109+
path: ~/.m2
110+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
111+
restore-keys: |
112+
${{ runner.os }}-maven-
113+
114+
- name: Import GPG key
115+
run: |
116+
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
117+
env:
118+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
119+
120+
- name: Build and Deploy with Maven
121+
env:
122+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
123+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
124+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
125+
run: |
126+
if [[ "${{ needs.setup.outputs.version }}" == *-SNAPSHOT ]]; then
127+
echo "------- Maven Deploy snapshot on ${{ github.event_name }} -------";
128+
mvn -B -e -f pom.xml clean deploy --settings maven-settings.xml
129+
else
130+
echo "------- Maven Deploy release on ${{ github.event_name }} -------";
131+
mvn -B -e -f pom.xml clean deploy -DperformRelease=true --settings maven-settings.xml
132+
fi

build.number

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

build.properties

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

build.xml

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
<project default="clean" basedir="." name="lucee-tasks-extension">
33
<description>Build process for the Tasks extension</description>
44

5-
<!-- load the build.properties -->
6-
<property file="build.properties"/>
7-
85
<!-- path defintions -->
96
<property name="src" location="source"/>
107
<property name="srcCFML" location="source/cfml"/>
@@ -13,9 +10,6 @@
1310
<property name="temp" location="temp"/>
1411
<property name="target" location="target"/>
1512

16-
<!-- auto increment build number -->
17-
<buildnumber file="build.number"/>
18-
1913
<target name="init" description="initalize the enviroment">
2014
<!-- <tstamp/> -->
2115
<!-- delete structure from previous build (if existing) -->
@@ -35,13 +29,13 @@
3529

3630
<echo file="${temp}/META-INF/MANIFEST.MF">Manifest-Version: 1.0
3731
Built-Date: ${NOW}
38-
version: "${bundleversion}${build.number}${appendix}"
32+
version: "${bundleversion}"
3933
id: "${id}"
4034
name: "${label}"
4135
description: "${description}"
4236
lucee-core-version: "${luceeCoreVersion}"
4337
release-type: ${releaseType}
44-
event-gateway-instance: "[{'cfc-path':'org.lucee.cfml.TasksGateway','id':'${task-instance-name}','read-only':true,'startup-mode':'automatic','custom':{'package':"${task-instance-package}",'templatePath':"",'checkForChangeInterval':10,'settingLocation':"${setting-location}",'checkForChangeSettingInterval':${check-for-change-setting-interval},'logName':"scheduler"}}]"
38+
event-gateway-instance: "[{'cfc-path':'org.lucee.cfml.TasksGateway','id':'${taskInstanceName}','read-only':true,'startup-mode':'automatic','custom':{'package':"${taskInstancePackage}",'templatePath':"",'checkForChangeInterval':10,'settingLocation':"${settingLocation}",'checkForChangeSettingInterval':${checkForChangeSettingInterval},'logName':"scheduler"}}]"
4539
</echo>
4640

4741
</target>
@@ -62,15 +56,6 @@ event-gateway-instance: "[{'cfc-path':'org.lucee.cfml.TasksGateway','id':'${task
6256
</fileset>
6357
</copy>
6458

65-
<!-- copy the plugins
66-
<copy todir="${temp}/webcontexts/admin/plugin">
67-
<fileset dir="${src}/plugins">
68-
<include name="**/*.cfc"/>
69-
<include name="**/*.cfm"/>
70-
<include name="**/language.xml"/>
71-
</fileset>
72-
</copy> -->
73-
7459
<!-- copy the event-gateway -->
7560
<copy todir="${temp}/event-gateways">
7661
<fileset dir="${src}/event-gateways">
@@ -84,22 +69,8 @@ event-gateway-instance: "[{'cfc-path':'org.lucee.cfml.TasksGateway','id':'${task
8469
</fileset>
8570
</copy>
8671

87-
<!-- copy the web context
88-
<copy todir="${temp}/applications">
89-
<fileset dir="${srcCFML}">
90-
<include name="**/*.*"/>
91-
</fileset>
92-
</copy> -->
93-
94-
<!-- copy the jars
95-
<copy todir="${temp}/jars">
96-
<fileset dir="${jars}">
97-
<include name="**/*.jar"/>
98-
</fileset>
99-
</copy> -->
100-
10172
<!-- Zip everything -->
102-
<zip destfile="${target}/${bundlename}-${bundleversion}${build.number}${appendix}.lex">
73+
<zip destfile="${target}/${filename}-${bundleversion}.lex">
10374
<zipfileset dir="${temp}"/>
10475
</zip>
10576

maven-settings.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
5+
<pluginGroups></pluginGroups>
6+
<proxies></proxies>
7+
<servers>
8+
<server>
9+
<id>ossrh</id>
10+
<username>${env.MAVEN_USERNAME}</username>
11+
<password>${env.MAVEN_PASSWORD}</password>
12+
</server>
13+
</servers>
14+
<mirrors></mirrors>
15+
<profiles>
16+
<profile>
17+
<id>ossrh</id>
18+
<activation>
19+
<activeByDefault>true</activeByDefault>
20+
</activation>
21+
<properties>
22+
<gpg.executable>gpg2</gpg.executable>
23+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
24+
</properties>
25+
</profile>
26+
</profiles>
27+
</settings>

0 commit comments

Comments
 (0)