From b08c74afbd996e0af858ef8bcbf45e53d1c6cba8 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Thu, 15 Apr 2021 17:24:56 +0200 Subject: [PATCH] Replace Travis CI with Github Actions. This commit introduces a Github Actions workflow in the form of the file `.github/workflows/build.yml`, replacing Travis CI and its `.travis.yml` file. The new workflow does a little bit more than Travis CI: it uploads an artifact after a successful build. Due to a known issue with Github's package UI, the MobArena.jar file is dynamically zipped on download, so we get MobArena.jar.zip containing just MobArena.jar. It's redundant, but there doesn't seem to be a simple way around it at the time of this commit, so we'll leave it be. For now, the workflow runs on every push to every branch. I'm probably going to regret that, but we'll leave that as it is for now as well. --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ .travis.yml | 3 --- README.md | 2 +- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..65833dd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build MobArena + +on: push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: 'Checkout source code' + uses: actions/checkout@v2 + - name: 'Set up JDK' + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: 'Cache dependencies' + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: 'Build, test, and package' + run: mvn -B package --file pom.xml + - name: 'Upload artifact' + uses: actions/upload-artifact@v2 + with: + name: MobArena.jar + path: target/MobArena.jar diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 67f92d3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: java -jdk: -- openjdk8 diff --git a/README.md b/README.md index d2cf6ac..d098652 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MobArena [![Build Status](https://travis-ci.org/garbagemule/MobArena.svg?branch=master)](https://travis-ci.org/garbagemule/MobArena) +MobArena [![Build Status](https://github.com/garbagemule/MobArena/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/garbagemule/MobArena/actions/workflows/build.yml) ======== MobArena is an arena-style minigame for Spigot-based Minecraft servers