Github Travis #311
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.9.2 ] | |
workflow_dispatch: # For manual trigger | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Adopt OpenJDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
java-package: jdk | |
- 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/msi.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 }} | |