blob: c1b08ddc667b5f1a6457ff089575d7695eec7ef8 [file] [log] [blame] [raw]
name: Dev Build
on:
push:
branches: [dev]
paths:
- .github/workflows/**
- etc/checkstyle.xml
- src/**
- pom.xml
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
name: Dev Build (Java ${{ matrix.java }})
steps:
- uses: actions/checkout@v2
- name: Set up Maven
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
server-id: glowstone-upstream
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache Maven
run: mvn -T 1C -B dependency:go-offline
- name: Publish to Maven
run: mvn -T 1C -B source:jar javadoc:jar deploy -Pbuild-extras --file pom.xml
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
JAVA_TOOL_OPTIONS: -Xmx2G
- name: Setup SSH
run: |
mkdir -p ~/.ssh
cat << EOF > ~/.ssh/config
Host *
ControlMaster auto
ControlPath ~/.ssh/-%r@%h:%p
ControlPersist 120
EOF
- name: Deploy to Test Server
run: |
scp target/glowstone.jar $SSH_USERNAME@$SSH_ADDRESS:
ssh $SSH_USERNAME@$SSH_ADDRESS sudo systemctl restart glowstone
env:
SSH_ADDRESS: ${{ secrets.SSH_ADDRESS }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}