-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (118 loc) · 3.81 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- master
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
checks: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Master Branch
uses: actions/checkout@v2
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/build.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Override http://repo.gate.ac.uk to use https:// instead
- name: Configure Maven settings
uses: whelk-io/maven-settings-xml-action@v20
with:
mirrors: >
[
{
"id": "gate.ac.uk-https",
"name": "GATE repo (secure)",
"mirrorOf": "gate.ac.uk",
"url": "https://repo.gate.ac.uk/content/groups/public/"
}
]
repositories: >
[
{
"id": "central",
"name": "Maven Central",
"url": "https://repo1.maven.org/maven2",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "false"
}
}
]
plugin_repositories: >
[
{
"id": "central",
"name": "Maven Central",
"url": "https://repo1.maven.org/maven2",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "false"
}
}
]
servers: >
[
{
"id": "gate.snapshots",
"username": "${{ secrets.GATE_REPO_USERNAME }}",
"password": "${{ secrets.GATE_REPO_PASSWORD }}"
}
]
- name: Build with Ant
run: ant clean build test
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
with:
report_paths: TEST-*.xml
fail_if_no_tests: false
- name: Build JavaDoc documentation
run: ant javadoc
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'doc/javadoc'
- name: Build distribution
run: ant distro
- name: Deploy to repo.gate.ac.uk
if: github.repository == 'GateNLP/gateplugin-Ontology' && github.ref == 'refs/heads/master'
run: >
ZIPFILE=`ls -1 gateplugin-Ontology-*.zip | head -n 1`
VERSION=`echo $ZIPFILE | sed 's/^gateplugin-Ontology-\(.*\)\.zip/\1/'`
mvn --batch-mode deploy:deploy-file -Dfile=$ZIPFILE
-DrepositoryId=gate.snapshots -Durl=https://repo.gate.ac.uk/content/repositories/snapshots
-DgroupId=uk.ac.gate.plugins -DartifactId=gateplugin-Ontology -Dversion=$VERSION
-Dpackaging=zip
# We want to avoid cacheing -SNAPSHOT dependencies from our local maven
# cache, to ensure that we always go out and check for them again at the
# next build in case they have changed.
- name: Delete snapshots from m2 repository
if: always()
run: |
find ~/.m2/repository -name \*-SNAPSHOT -type d -exec rm -rf {} \+ || :
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy JavaDoc to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1