From 477188c28c4296a8372578cfca9833034918f46c Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Thu, 20 Jun 2024 22:46:50 +0200 Subject: [PATCH] add maven deployment --- .github/workflows/main.yml | 43 ++++++- .gitignore | 2 +- build.number | 3 - build.properties | 10 -- build.xml | 75 ++++------- maven-settings.xml | 27 ++++ pom.xml | 253 +++++++++++++++++++++++++++++++++++++ source/fld/function.fld | 1 - 8 files changed, 344 insertions(+), 70 deletions(-) delete mode 100644 build.number delete mode 100644 build.properties create mode 100755 maven-settings.xml create mode 100644 pom.xml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4fe0416..0ce9dc7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,8 +34,14 @@ jobs: with: path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache key: lucee-downloads - - name: Build extension-s3 with Ant - run: ant -noinput -verbose -buildfile build.xml + - name: Build and Install with Maven + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + echo "------- Maven Install -------"; + mvn -B -e -f pom.xml clean install - name: Upload Artifact uses: actions/upload-artifact@v4 with: @@ -76,3 +82,36 @@ jobs: S3_GOOGLE_SECRET_KEY: ${{ secrets.S3_GOOGLE_SECRET_KEY }} S3_GOOGLE_HOST: storage.googleapis.com S3_GOOGLE_BUCKET_PREFIX: lucee-ldev-e- + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Extract version number + id: extract-version + run: | + VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Import GPG key + run: | + echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + + - name: Build and Deploy with Maven + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + if [[ "$VERSION" == *-SNAPSHOT ]]; then + echo "------- Maven Deploy snapshot on ${{ github.event_name }} -------"; + mvn -B -e -f pom.xml clean deploy --settings maven-settings.xml + else + echo "------- Maven Deploy release on ${{ github.event_name }} -------"; + mvn -B -e -f pom.xml clean deploy -DperformRelease=true --settings maven-settings.xml + fi diff --git a/.gitignore b/.gitignore index ef59bb6..32aeee0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/dist +/target **/Test.java **/TestCase.java **/.DS_Store diff --git a/build.number b/build.number deleted file mode 100644 index ab49974..0000000 --- a/build.number +++ /dev/null @@ -1,3 +0,0 @@ -#Build Number for ANT. Do not edit! -#Mon Jun 17 22:27:19 CEST 2024 -build.number=18 diff --git a/build.properties b/build.properties deleted file mode 100644 index d337837..0000000 --- a/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bundlename: s3.extension -filename: s3-extension -bundleversion: 2.0.2. -id: 17AB52DE-B300-A94B-E058BD978511E39E -luceeCoreVersion: 5.0.0.157 -releaseType: server -appendix: -SNAPSHOT -label: S3 Resource Extension -description: Core Extension to integrate Amazon Simple Storage Service (S3) Resource into Lucee. -class: org.lucee.extension.resource.s3.S3ResourceProvider \ No newline at end of file diff --git a/build.xml b/build.xml index 1dedd49..87f6cc3 100644 --- a/build.xml +++ b/build.xml @@ -1,43 +1,21 @@ - + - Build Form Extension + Build S3 Extension - - - + - - - - - - - - - - - @@ -77,14 +55,14 @@ Manifest-Version: 1.0 Built-Date: ${NOW} -version: "${bundleversion}${build.number}${appendix}" +version: "${bundleversion}" id: "${id}" name: "${label}" description: "${description}" lucee-core-version: "${luceeCoreVersion}" release-type: ${releaseType} start-bundles: false -resource: "[{'class':'${class}','bundleName':'${bundlename}','bundleVersion':'${bundleversion}${build.number}${appendix}','scheme':'s3','lock-timeout':'10000'}]" +resource: "[{'class':'${class}','bundleName':'${bundlename}','bundleVersion':'${bundleversion}','scheme':'s3','lock-timeout':'10000'}]" @@ -104,9 +82,9 @@ resource: "[{'class':'${class}','bundleName':'${bundlename}','bundleVersion':'${ + jarfile="${dist}/extension/jars/${bundlename}-${bundleversion}.jar" basedir="${build}" manifest="${src}/META-INF/MANIFEST.MF"> - + @@ -114,28 +92,18 @@ resource: "[{'class':'${class}','bundleName':'${bundlename}','bundleVersion':'${ - - - - - - - - - - - + + + @@ -166,7 +134,7 @@ resource: "[{'class':'${class}','bundleName':'${bundlename}','bundleVersion':'${ - + @@ -174,8 +142,9 @@ resource: "[{'class':'${class}','bundleName':'${bundlename}','bundleVersion':'${ - - + + + \ No newline at end of file diff --git a/maven-settings.xml b/maven-settings.xml new file mode 100755 index 0000000..3647539 --- /dev/null +++ b/maven-settings.xml @@ -0,0 +1,27 @@ + + + + + + + ossrh + ${env.MAVEN_USERNAME} + ${env.MAVEN_PASSWORD} + + + + + + ossrh + + true + + + gpg2 + ${env.GPG_PASSPHRASE} + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..82bcef9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,253 @@ + + 4.0.0 + org.lucee + s3-extension + 2.0.2.17-SNAPSHOT + pom + S3 Extension + + + UTF-8 + 11 + 11 + 17AB52DE-B300-A94B-E058BD978511E39E + org.lucee.s3.extension + 5.0.0.157 + server + + org.lucee.extension.resource.s3.S3ResourceProvider + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + https://oss.sonatype.org/content/repositories/snapshots/ + + + https://github.com/lucee/extension-s3 + scm:git:git://github.com/lucee/extension-s3.git + scm:git:git@github.com:lucee/extension-s3.git + ${project.version} + + + + + ossrh + ${release.url} + + + ossrh + ${snapshot.url} + + + + + + The GNU Lesser General Public License, Version 2.1 + http://www.gnu.org/licenses/lgpl-2.1.txt + repo + + + + + + micstriit + Michael Offner + michael@lucee.org + Lucee Association Switzerland + http://lucee.org + + Project-Administrator + Developer + + +1 + + + + Core Extension to integrate Amazon Simple Storage Service (S3) Resource into Lucee. + https://github.com/lucee/extension-kinesis + + + + release-sign-artifacts + + + performRelease + true + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + ${project.build.directory}/${project.artifactId}-${project.version}.lex + + + + + + + org.apache.maven.plugins + maven-release-plugin + 3.0.0 + + true + false + release + deploy + + + + + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.8 + + + package + + run + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + attach-artifacts + package + + attach-artifact + + + + + ${project.build.directory}/${project.artifactId}-${project.version}.lex + lex + + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + cleanup + post-package + + clean + + + + + ${project.build.directory}/antrun + + **/* + + + + ${project.build.directory}/archive-tmp + + **/* + + + + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.0.0-M1 + + + default-deploy + deploy + + deploy-file + + + ${project.build.directory}/${project.artifactId}-${project.version}.lex + ${project.groupId} + ${project.artifactId} + ${project.version} + ossrh + ${deploy.url} + lex + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + true + + + + + diff --git a/source/fld/function.fld b/source/fld/function.fld index 788c846..909eca4 100755 --- a/source/fld/function.fld +++ b/source/fld/function.fld @@ -1524,7 +1524,6 @@ - S3GetVersionInfo