75 lines (63 loc) · 2.38 KB
/
github-travis.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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Github Travis
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ GAMA_1.8.2 ]
schedule:
- cron: "0 0 * * *"
workflow_dispatch: # For manual trigger
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Adopt OpenJDK 15
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '15'
java-package: jdk
- name: Prepare build
run: |
echo "MAVEN_OPTS='-Dorg.slf4j.simpleLogger.defaultLogLevel=error -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx2048m'" >> ~/.mavenrc
sudo chmod +x $GITHUB_WORKSPACE/travis/*.sh
- 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-
- name: Build with Maven
shell: bash
run: $GITHUB_WORKSPACE/travis/compile.sh
env:
MSG: ${ github.event.head_commit.message }
- name: Validate and test Maven
shell: bash
run: $GITHUB_WORKSPACE/travis/validate_and_test.sh
env:
MSG: ${ github.event.head_commit.message }
- name: Set Travis env
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "[WARNING] Forcing travis version release"
echo "TRAVIS_MSG=ci release" >> $GITHUB_ENV
else
echo "TRAVIS_MSG=$(echo $github.event.head_commit.message )" >> $GITHUB_ENV
fi
echo $TRAVIS_MSG
- name: Publish to Github
shell: bash
run: $GITHUB_WORKSPACE/travis/publish.sh
env:
SSH_USER_PWD: ${{ secrets.USER_PWD }}
SSH_HOST: ${{ secrets.SSH_HOST }}
MSG: ${{ env.TRAVIS_MSG }}
GITHUB_TOKEN: ${{ github.token }}
SSHPASS: ${{ secrets.USER_PWD }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
TRAVIS_COMMIT: ${ GITHUB_SHA }
TRAVIS_EVENT_TYPE: ${{ github.event_name }}