Skip to content

Commit

Permalink
Testing github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRedMagic committed Jul 6, 2024
1 parent cd42927 commit e4b208d
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/api-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
push:
branches: [ master ]
jobs:
publish:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ "1.21", "1.20.4", "1.20.5", "1.20.6" ]
version: [ "1.21", "1.22", "1.23" ] # Add needed versions here
steps:
- uses: actions/checkout@v2
- name: Set up JDK
Expand All @@ -18,32 +18,39 @@ jobs:
java-version: 18
- name: Grant execute permission for gradlew
run: chmod +x gradlew


- name: "Cache: Maven-Repository"
uses: actions/cache@v2
id: spigot
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-maven-
${{ runner.os }}-maven-
- name: Run Spigot-BuildTools
if: steps.spigot.outputs.cache-hit != 'true'
run: |
mkdir -p .spigot-buildtools
cd .spigot-buildtools
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O BuildTools.jar
java -jar BuildTools.jar --rev ${{ matrix.version }} --remapped
cd ..
rm -R .spigot-buildtools
cd .spigot-buildtools
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O BuildTools.jar
java -jar BuildTools.jar --rev ${{ matrix.version }} --remapped
cd ..
rm -R .spigot-buildtools
env:
SPIGOT_M2: ~/.m2/repository/org/spigotmc/spigot


publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 18
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Publish with Gradle
run: ./gradlew shadowJar publish
env:
MAVEN_NAME: ${{ secrets.MAVEN_NAME }} # token name
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }} # token secret (password)
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }} # token secret (password)

0 comments on commit e4b208d

Please sign in to comment.