Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub actions #92

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
133 changes: 133 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
name: Build the plugin
on: [ push ]
jobs:
install-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache maven repository
id: cache-mvn
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up Maven
uses: stCarolas/[email protected]

- name: Install Spigot 1.20.4
uses: SpraxDev/Action-SpigotMC@v4
with:
versions: 1.20.4
remapped: true
buildToolProvider: SpigotMC

- name: Install Spigot 1.20.2
uses: SpraxDev/Action-SpigotMC@v4
with:
versions: 1.20.2
remapped: true
buildToolProvider: SpigotMC

- name: Install Spigot 1.20.1
uses: SpraxDev/Action-SpigotMC@v4
with:
versions: 1.20.1
remapped: true
buildToolProvider: SpigotMC

- name: Install Spigot 1.19.4
uses: SpraxDev/Action-SpigotMC@v4
with:
versions: 1.19.4
remapped: true
buildToolProvider: SpigotMC

- name: Install Spigot 1.18.2
uses: SpraxDev/Action-SpigotMC@v4
with:
versions: 1.18.2
remapped: true
buildToolProvider: SpigotMC

- name: Check out nightcore
uses: actions/checkout@v4
with:
repository: 'nulli0n/nightcore-spigot'
ref: 'f70589cbe2b2fde92a1941e76a408dc1296490c5'
path: 'nightcore'

- name: Install nightcore
run: mvn install
working-directory: ./nightcore

ci:
runs-on: ubuntu-latest
needs: [ install-dependencies ]
strategy:
matrix:
spigot:
- 1.20.2-R0.1-SNAPSHOT
- 1.20.1-R0.1-SNAPSHOT
- 1.19.4-R0.1-SNAPSHOT
- 1.18.2-R0.1-SNAPSHOT
steps:
- uses: actions/checkout@v4

- name: Cache maven repository
id: cache-mvn
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up Maven
uses: stCarolas/[email protected]

- name: Package plugin
run: mvn package -Dspigot.version=${{ matrix.spigot }}

build:
runs-on: ubuntu-latest
needs: [ install-dependencies ]
steps:
- uses: actions/checkout@v4

- name: Cache maven repository
id: cache-mvn
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up Maven
uses: stCarolas/[email protected]

- name: Package plugin
run: mvn package

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ExcellentEnchants
path: target/*.jar
3 changes: 2 additions & 1 deletion Core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
</properties>

<repositories>
Expand Down Expand Up @@ -44,7 +45,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<version>${spigot.version}</version>
</dependency>
<dependency>
<groupId>fr.neatmonster</groupId>
Expand Down