Skip to content

Commit faf16e5

Browse files
committed
Update main.yml
1 parent 530c2c7 commit faf16e5

File tree

1 file changed

+25
-57
lines changed

1 file changed

+25
-57
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ on:
1515
default: '["6.2/stable/light", "7.0/stable/light"]'
1616

1717
jobs:
18-
setup:
18+
build:
1919
runs-on: ubuntu-latest
2020
outputs:
2121
version: ${{ steps.extract-version.outputs.VERSION }}
2222
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@v4
23+
- uses: actions/checkout@v4
2524

2625
- name: Set up JDK 11
2726
uses: actions/setup-java@v4
@@ -43,36 +42,36 @@ jobs:
4342
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
4443
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
4544
45+
- name: Build extension
46+
run: mvn -B -e -f pom.xml clean install -Dgoal=install
47+
48+
- name: Upload Artifact
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: crypto-lex
52+
path: target/*.lex
53+
4654
- name: Cache Lucee files
4755
uses: actions/cache@v4
4856
with:
4957
path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache
5058
key: lucee-downloads
5159

52-
build-and-test:
60+
test:
5361
runs-on: ubuntu-latest
54-
needs: setup
62+
needs: build
5563
strategy:
5664
fail-fast: false
5765
matrix:
5866
lucee: ${{ fromJSON(inputs.luceeVersions || vars.LUCEE_TEST_VERSIONS || '["6.2/stable/light", "7.0/snapshot/light"]') }}
5967
steps:
6068
- uses: actions/checkout@v4
6169

62-
- name: Set up JDK 11
63-
uses: actions/setup-java@v4
70+
- name: Download extension artifact
71+
uses: actions/download-artifact@v4
6472
with:
65-
java-version: '11'
66-
distribution: 'adopt'
67-
68-
- name: Build and Install with Maven (for testing only)
69-
env:
70-
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
71-
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
72-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
73-
run: |
74-
echo "------- Maven Install (to create a local test build) -------";
75-
mvn -B -e -f pom.xml clean install -Dgoal=install
73+
name: crypto-lex
74+
path: target
7675

7776
- name: Checkout Lucee
7877
uses: actions/checkout@v4
@@ -92,43 +91,12 @@ jobs:
9291
testAdditional: ${{ github.workspace }}/tests
9392
LUCEE_ADMIN_PASSWORD: admin
9493

95-
upload-artifact:
96-
runs-on: ubuntu-latest
97-
needs: [setup, build-and-test]
98-
if: needs.build-and-test.result == 'success'
99-
steps:
100-
- uses: actions/checkout@v4
101-
102-
- name: Set up JDK 11
103-
uses: actions/setup-java@v4
104-
with:
105-
java-version: '11'
106-
distribution: 'temurin'
107-
108-
- name: Cache Maven packages
109-
uses: actions/cache@v4
110-
with:
111-
path: ~/.m2
112-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
113-
restore-keys: |
114-
${{ runner.os }}-maven-
115-
116-
- name: Build
117-
run: mvn -B -e -f pom.xml clean package -DskipTests
118-
119-
- name: Upload Artifact
120-
uses: actions/upload-artifact@v4
121-
with:
122-
name: crypto-lex
123-
path: target/*.lex
124-
12594
deploy:
12695
runs-on: ubuntu-latest
127-
needs: [setup, build-and-test]
128-
if: github.event_name == 'workflow_dispatch' && inputs.deploy && needs.build-and-test.result == 'success'
96+
needs: [build, test]
97+
if: github.event_name == 'workflow_dispatch' && inputs.deploy && needs.test.result == 'success'
12998
steps:
130-
- name: Checkout repository
131-
uses: actions/checkout@v4
99+
- uses: actions/checkout@v4
132100

133101
- name: Set up JDK 11
134102
uses: actions/setup-java@v4
@@ -156,13 +124,13 @@ jobs:
156124
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
157125
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
158126
run: |
159-
if [[ "${{ needs.setup.outputs.version }}" == *-SNAPSHOT ]]; then
160-
echo "------- Maven Deploy snapshot on ${{ github.event_name }} -------";
127+
if [[ "${{ needs.build.outputs.version }}" == *-SNAPSHOT ]]; then
128+
echo "------- Maven Deploy snapshot -------";
161129
mvn -B -e -f pom.xml clean deploy -Dgoal=deploy --settings maven-settings.xml
162-
elif [[ "${{ needs.setup.outputs.version }}" == *-ALPHA ]]; then
163-
echo "------- Maven Install alpha on ${{ github.event_name }} -------";
130+
elif [[ "${{ needs.build.outputs.version }}" == *-ALPHA ]]; then
131+
echo "------- Maven Install alpha -------";
164132
mvn -B -e -f pom.xml clean install -Dgoal=install --settings maven-settings.xml
165133
else
166-
echo "------- Maven Deploy release on ${{ github.event_name }} -------";
134+
echo "------- Maven Deploy release -------";
167135
mvn -B -e -f pom.xml clean deploy -Dgoal=deploy -DperformRelease=true --settings maven-settings.xml
168136
fi

0 commit comments

Comments
 (0)