-
Notifications
You must be signed in to change notification settings - Fork 6
80 lines (68 loc) · 3 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
76
77
78
79
80
# 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_2024-06 ]
workflow_dispatch: # For manual trigger
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Adopt OpenJDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
java-package: jdk
- name: Update Maven to 3.9.X
run: |
# Needed for Tycho 4.X.X and support for JDK 21
wget https://dlcdn.apache.org/maven/maven-3/3.9.7/binaries/apache-maven-3.9.7-bin.tar.gz
tar -xvf apache-maven-3.9.7-bin.tar.gz
mv apache-maven-3.9.7 /opt/
M2_HOME='/opt/apache-maven-3.9.7'
PATH="$M2_HOME/bin:$PATH"
export PATH
# Overwrite PATH with updated maven install
echo $PATH > $GITHUB_PATH
echo "=== Check if well installed ==="
echo "$ mvn -version"
mvn -version
- name: Prepare p2 VPS access
run: |
echo "Publishing p2 repository"
sed -i "s/<username>GAMA_PASS/<username>$GAMA_SERVER_USERNAME/g" $GITHUB_WORKSPACE/settings.xml
sed -i "s/<password>GAMA_PASS/<password>$GAMA_SERVER_PASSWORD/g" $GITHUB_WORKSPACE/settings.xml
env:
GAMA_SERVER_USERNAME: ${{ secrets.GAMA_SERVER_USERNAME }}
GAMA_SERVER_PASSWORD: ${{ secrets.GAMA_SERVER_PASSWORD }}
- name: Install SSH key
# Consider it's a release and want to update p2 site for it
if: "${{ inputs.get_all_archives_for_release }}"
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.GAMA_SERVER_SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.GAMA_SERVER_SSH_KNOWN_HOSTS }}
if_key_exists: replace # replace / ignore / fail; optional (defaults to fail)
- name: Import JAR signing keystore
run: |
echo "$GAMA_KEYSTORE_BASE64" | base64 --decode > ~/gama.keystore
# Config file
sed -i "s/<storepass>GAMA_STORE/<storepass>$GAMA_STORE/g" $GITHUB_WORKSPACE/gama.experimental.parent/pom_footer.xml
env:
GAMA_KEYSTORE_BASE64: ${{ secrets.GAMA_KEYSTORE_BASE64 }}
GAMA_STORE: ${{ secrets.GAMA_KEYSTORE_STOREPASS }}
- name: Build with Maven
run: bash $GITHUB_WORKSPACE/travis_build.sh
env:
MSG: ${ github.event.head_commit.message }
SSH_USER_PWD: ${{ secrets.USER_PWD }}
SSH_HOST: ${{ secrets.SSH_HOST }}
GITHUB_TOKEN: ${{ github.token }}
SSHPASS: ${{ secrets.USER_PWD }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
TRAVIS_COMMIT: ${ GITHUB_SHA }
TRAVIS_EVENT_TYPE: ${{ github.event_name }}