Update README.md #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Java CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| deploy: | |
| description: 'Deploy to Maven Central' | |
| type: boolean | |
| default: false | |
| luceeVersions: | |
| description: 'JSON array of Lucee versions to test' | |
| required: false | |
| default: '[{"version":"","query":"7.0/stable/light"},{"version":"","query":"7.1/snapshot/light"}]' | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.extract-version.outputs.VERSION }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'temurin' | |
| - name: Cache Maven packages | |
| uses: actions/cache@v4 | |
| 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_OUTPUT | |
| - name: Cache Lucee files | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache | |
| key: lucee-downloads | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| lucee: ${{ fromJSON(inputs.luceeVersions || vars.LUCEE_TEST_VERSIONS_PLUS || '[{"version":"","query":"7.0/stable/light"},{"version":"","query":"7.1/snapshot/light"}]') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'adopt' | |
| - name: Build and Install with Maven (for testing only) | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| run: | | |
| echo "------- Maven Install (to create a local test build) -------"; | |
| mvn -B -e -f pom.xml clean install -Dgoal=install | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: crypto-lex-${{ matrix.lucee.version }} | |
| path: target/*.lex | |
| - name: Checkout Lucee | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: lucee/lucee | |
| path: lucee | |
| ref: ${{ matrix.lucee.branch }} | |
| - name: Run Lucee Test Suite | |
| uses: lucee/script-runner@main | |
| with: | |
| webroot: ${{ github.workspace }}/lucee/test | |
| execute: /bootstrap-tests.cfm | |
| luceeVersion: ${{ matrix.lucee.version }} | |
| luceeVersionQuery: ${{ matrix.lucee.query }} | |
| extensionDir: ${{ github.workspace }}/target | |
| env: | |
| testLabels: crypto | |
| testAdditional: ${{ github.workspace }}/tests | |
| LUCEE_ADMIN_PASSWORD: admin | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: [setup, build-and-test] | |
| if: github.event_name == 'workflow_dispatch' && inputs.deploy && needs.build-and-test.result == 'success' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '11' | |
| - name: Cache Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - 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 [[ "${{ needs.setup.outputs.version }}" == *-SNAPSHOT ]]; then | |
| echo "------- Maven Deploy snapshot on ${{ github.event_name }} -------"; | |
| mvn -B -e -f pom.xml clean deploy -Dgoal=deploy --settings maven-settings.xml | |
| elif [[ "${{ needs.setup.outputs.version }}" == *-ALPHA ]]; then | |
| echo "------- Maven Install alpha on ${{ github.event_name }} -------"; | |
| mvn -B -e -f pom.xml clean install -Dgoal=install --settings maven-settings.xml | |
| else | |
| echo "------- Maven Deploy release on ${{ github.event_name }} -------"; | |
| mvn -B -e -f pom.xml clean deploy -Dgoal=deploy -DperformRelease=true --settings maven-settings.xml | |
| fi |