Skip to content

Merge pull request #6 from Cong0707/master #2

Merge pull request #6 from Cong0707/master

Merge pull request #6 from Cong0707/master #2

Workflow file for this run

name: Maven build
on:
push:
branches: [ master ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]
jobs:
build_and_test:
if: github.repository_owner == 'uskyblock'
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout submodules
run: |
sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
git submodule update --init --recursive
- name: Generate additional language files
run: |
cd uSkyBlock-Core/src/main/po && perl en2pirate.pl && cd -
cd uSkyBlock-Core/src/main/po && perl en2kitteh.pl && cd -
- name: JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Build with Maven
run: gradle build
# Install our SSH key:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
if: ${{ github.event_name == 'push' }}
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOST }}
# Mark our scripts runnable:
- name: Mark deploy scripts runnable
if: ${{ github.event_name == 'push' }}
run: |
chmod +x "${GITHUB_WORKSPACE}/.github/deploy-staging.sh"
chmod +x "${GITHUB_WORKSPACE}/.github/deploy-release.sh"
# Deploy from master branch (staging release):
- name: Run deploy script for staging release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: "${GITHUB_WORKSPACE}/.github/deploy-staging.sh"
# Deploy from tag create (plugin release):
- name: Run deploy script for plugin release
if: ${{ github.event_name == 'push' && startsWith( github.ref, 'refs/tags/') }}
run: "${GITHUB_WORKSPACE}/.github/deploy-release.sh"