Skip to content

Commit 2540ad1

Browse files
committed
Update github action config script
1 parent caca7ef commit 2540ad1

1 file changed

Lines changed: 37 additions & 12 deletions

File tree

github-actionify.sh

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
dir="$(dirname "$0")"
1515

1616
gitactionDir=.github
17-
gitactionConfig=.gitaction.yml
17+
gitactionConfig=$gitactionDir/workflows/.gitaction.yml
1818
gitactionBuildScript=$gitactionDir/build.sh
1919
gitactionSettingsFile=$gitactionDir/settings.xml
2020
gitactionNotifyScript=$gitactionDir/notify.sh
@@ -123,17 +123,42 @@ process() {
123123

124124
# Add/update the GitHun Actions configuration file.
125125
cat >"$tmpFile" <<EOL
126-
language: java
127-
jdk: openjdk8
128-
branches:
129-
only:
130-
- $defaultBranch
131-
- "/.*-[0-9]+\\\\..*/"
132-
install: true
133-
script: "$gitactionBuildScript"
134-
cache:
135-
directories:
136-
- "~/.m2/repository"
126+
name: SciJava CI
127+
128+
on:
129+
push:
130+
branches:
131+
- $defaultBranch
132+
pull_request:
133+
branches:
134+
- $defaultBranch
135+
136+
jobs:
137+
build:
138+
runs-on: ubuntu-latest
139+
140+
steps:
141+
- uses: actions/checkout@v2
142+
143+
- name: Cache m2 modules
144+
uses: actions/cache@v2
145+
env:
146+
cache-name: cache-node-modules
147+
with:
148+
path: ~/.m2
149+
key: \${{ runner.os }}-build-\${{ env.cache-name }}
150+
restore-keys: |
151+
\${{ runner.os }}-build-\${{ env.cache-name }}-
152+
\${{ runner.os }}-build-
153+
\${{ runner.os }}-
154+
155+
- name: Set up JDK 8
156+
uses: actions/setup-java@v2
157+
with:
158+
java-version: '8'
159+
distribution: 'zulu'
160+
- name: Build with Maven
161+
run: ./$gitactionBuildScript
137162
EOL
138163
update "$gitactionConfig"
139164

0 commit comments

Comments
 (0)