-
-
Notifications
You must be signed in to change notification settings - Fork 41
78 lines (75 loc) · 2.71 KB
/
build-jsp.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
name: Build JSP
env:
CURRENT_UVERSION: 17.0.0 # FIX_FOR_NEW_VERSION
PREVIOUS_UVERSION: 16.0.0 # not used at present
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get the CLDR_REF from pom.xml
id: cldr_ref
run: echo "CLDR_REF="$(mvn help:evaluate -Dexpression=cldr.version -q -DforceStdout | cut -d- -f3) >> $GITHUB_OUTPUT && cat ${GITHUB_OUTPUT}
- name: Verify CLDR checkout ref
run: echo CLDR_REF="${{ steps.cldr_ref.outputs.CLDR_REF }}" && [ "${{ steps.cldr_ref.outputs.CLDR_REF }}x" != "x" ] # fail if empty
- name: Cache CLDR repository
uses: actions/cache@v3
with:
path: cldr
key: cldr-${{ steps.cldr_ref.outputs.CLDR_REF }}
restore-keys: |
cldr
- name: Check out CLDR
uses: actions/checkout@v3
with:
repository: unicode-org/cldr
path: cldr
ref: main
fetch-depth: 0
- name: Switch CLDR to CLDR_REF
run: cd cldr && git fetch && git checkout ${{ steps.cldr_ref.outputs.CLDR_REF }}
- name: Backup Unicodetools and CLDR for jsps # this is needed only for the Docker build
run:
mkdir -p UnicodeJsps/target && tar -cpz --exclude=.git -f UnicodeJsps/target/cldr-unicodetools.tgz ./cldr ./unicodetools
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# TODO: move this DOWN after JSPs once it works
- name: Regenerate the property cache files
run: >
mkdir -pv $(pwd)/Generated/ &&
mvn -s .github/workflows/mvn-settings.xml compile exec:java -Dexec.mainClass="org.unicode.jsp.RebuildPropertyCache"
-am -pl unicodetools
-DCLDR_DIR=${GITHUB_WORKSPACE}/cldr
-DUNICODETOOLS_REPO_DIR=$(pwd)
-DUNICODETOOLS_GEN_DIR=$(pwd)/Generated &&
tar -cpz -f UnicodeJsps/target/generated.tgz ./Generated
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Package JSPs
run: >
mvn -s .github/workflows/mvn-settings.xml -B -am -pl UnicodeJsps package -DskipTests=true -DCLDR_DIR=${GITHUB_WORKSPACE}/cldr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload UnicodeJsps.war
uses: actions/upload-artifact@v3
with:
name: UnicodeJsps
path: UnicodeJsps/target/UnicodeJsps.war
- name: build docker image
run: cd UnicodeJsps && bash update-bidic-ucd.sh && docker build .