-
Notifications
You must be signed in to change notification settings - Fork 8
159 lines (141 loc) · 5.15 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Java CI Combined
on: [push, pull_request, workflow_dispatch]
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:
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: Extract version number
id: extract-version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "::set-output name=VERSION::$VERSION"
- name: Cache Lucee files
uses: actions/cache@v4
with:
path: ~/work/_actions/lucee/script-runner/main/lucee-download-cache
key: lucee-downloads
- name: Import GPG key
run: |
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
build-and-test:
runs-on: ubuntu-latest
needs: setup
env:
S3_ACCESS_KEY_ID: ${{ secrets.S3_AMAZON_ACCESS_KEY_ID }}
S3_SECRET_KEY: ${{ secrets.S3_AMAZON_SECRET_KEY }}
S3_BUCKET_PREFIX: lucee-ldev-e-
S3_AMAZON_ACCESS_KEY_ID: ${{ secrets.S3_AMAZON_ACCESS_KEY_ID }}
S3_AMAZON_SECRET_KEY: ${{ secrets.S3_AMAZON_SECRET_KEY }}
S3_AMAZON_BUCKET_PREFIX: lucee-ldev-e-
S3_CUSTOM_ACCESS_KEY_ID: "minioadmin"
S3_CUSTOM_SECRET_KEY: "minioadmin"
S3_CUSTOM_HOST: "localhost:9000"
S3_CUSTOM_BUCKET_PREFIX: lucee-ldev-e-
S3_BACKBLAZE_ACCESS_KEY_ID: 005a56c2ce399e70000000001
S3_BACKBLAZE_SECRET_KEY: ${{ secrets.S3_BACKBLAZE_SECRET_KEY }}
S3_BACKBLAZE_HOST: s3.us-east-005.backblazeb2.com
S3_BACKBLAZE_BUCKET_PREFIX: lucee-ldev-e-
S3_WASABI_ACCESS_KEY_ID: JM8VC29WSODA1DRT2H4Y
S3_WASABI_SECRET_KEY: ${{ secrets.S3_WASABI_SECRET_KEY }}
S3_WASABI_HOST: s3.eu-central-1.wasabisys.com
S3_WASABI_BUCKET_PREFIX: lucee-ldev-e-
S3_GOOGLE_ACCESS_KEY_ID: ${{ secrets.S3_GOOGLE_ACCESS_KEY_ID }}
S3_GOOGLE_SECRET_KEY: ${{ secrets.S3_GOOGLE_SECRET_KEY }}
S3_GOOGLE_HOST: storage.googleapis.com
S3_GOOGLE_BUCKET_PREFIX: lucee-ldev-e-
LUCEE_TEST_VERSIONS: ${{ vars.LUCEE_TEST_VERSIONS }}
strategy:
matrix:
lucee: ${{ fromJSON(vars.LUCEE_TEST_VERSIONS) }}
services:
minio:
image: fclairamb/minio-github-actions
ports:
- 9000:9000
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
run: |
echo "------- Maven Install -------";
mvn -B -e -f pom.xml clean install
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: s3-lex-${{ matrix.lucee.version }}
path: target/*.lex
- name: Checkout Lucee
uses: actions/checkout@v4
with:
repository: lucee/lucee
path: lucee
- 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: s3
testAdditional: ${{ github.workspace }}/tests
deploy:
runs-on: ubuntu-latest
needs: [build-and-test]
if: always() && 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 --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