9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-19 14:59:21 +00:00

build: update CI to publish all active versions

This commit is contained in:
William
2024-09-05 13:49:12 +01:00
parent 605d314a58
commit 34e08b712d
2 changed files with 88 additions and 15 deletions

View File

@@ -16,20 +16,37 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout for CI 🛎️'
uses: actions/checkout@v4
- name: 'Set up JDK 21 📦'
- name: 'Setup JDK 21 📦'
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: 'Build with Gradle 🏗️'
uses: gradle/gradle-build-action@v3
- name: 'Setup Gradle 8.8 🏗️'
uses: gradle/actions/setup-gradle@v4
with:
arguments: build test publish
gradle-version: '8.8'
- name: '[Current - 1.21.1] Checkout for CI 🛎️'
uses: actions/checkout@v4
with:
path: '1.21.1'
- name: '[LTS - 1.20.1] Checkout for CI 🛎️'
uses: actions/checkout@v4
with:
ref: 'minecraft/1.20.1'
path: '1.20.1'
env:
SNAPSHOTS_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
SNAPSHOTS_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: '[Current - 1.21.1] Build 🛎️'
run: |
cd 1.21.1
./gradlew clean build publish
cd ..
- name: '[LTS - 1.20.1] Build 🛎️'
run: |
cd 1.20.1
./gradlew clean build publish
cd ..
- name: 'Publish Test Report 📊'
uses: mikepenz/action-junit-report@v4
if: success() || failure() # Continue on failure
@@ -37,11 +54,13 @@ jobs:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: 'Fetch Version Name 📝'
run: |
cd 1.21.1
echo "::set-output name=VERSION_NAME::$(${{github.workspace}}/gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')"
id: fetch-version
- name: Get Version
run: |
echo "version_name=${{steps.fetch-version.outputs.VERSION_NAME}}" >> $GITHUB_ENV
cd ..
- name: 'Publish to William278.net 🚀'
uses: WiIIiam278/bones-publish-action@v1
with:
@@ -53,12 +72,20 @@ jobs:
distro-names: |
paper-1.21.1
fabric-1.21.1
paper-1.20.1
fabric-1.20.1
distro-groups: |
paper
fabric
paper
fabric
distro-descriptions: |
Paper 1.21.1
Fabric 1.21.1
Paper 1.20.1
Fabric 1.20.1
files: |
target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.1.jar
target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.1.jar
1.21.1/target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.1.jar
1.21.1/target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.1.jar
1.20.1/target/HuskSync-Paper-${{ env.version_name }}+mc.1.20.1.jar
1.20.1/target/HuskSync-Fabric-${{ env.version_name }}+mc.1.20.1.jar

View File

@@ -8,26 +8,72 @@ permissions:
contents: read
checks: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout for CI 🛎️'
uses: actions/checkout@v4
- name: 'Set up JDK 21 📦'
- name: 'Setup JDK 21 📦'
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: 'Build with Gradle 🏗️'
uses: gradle/gradle-build-action@v3
- name: 'Setup Gradle 8.8 🏗️'
uses: gradle/actions/setup-gradle@v4
with:
arguments: build test publish
gradle-version: '8.8'
- name: '[Current - 1.21.1] Checkout for CI 🛎️'
uses: actions/checkout@v4
with:
path: '1.21.1'
- name: '[LTS - 1.20.1] Checkout for CI 🛎️'
uses: actions/checkout@v4
with:
ref: 'minecraft/1.20.1'
path: '1.20.1'
env:
RELEASES_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
RELEASES_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: '[Current - 1.21.1] Build 🛎️'
run: |
cd 1.21.1
./gradlew clean build publish
cd ..
- name: '[LTS - 1.20.1] Build 🛎️'
run: |
cd 1.20.1
./gradlew clean build publish
cd ..
- name: 'Publish Test Report 📊'
uses: mikepenz/action-junit-report@v4
if: success() || failure() # Continue on failure
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: 'Publish to William278.net 🚀'
uses: WiIIiam278/bones-publish-action@v1
with:
api-key: ${{ secrets.BONES_API_KEY }}
project: 'husksync'
channel: 'release'
version: ${{ github.event.release.tag_name }}
changelog: ${{ github.event.release.body }}
distro-names: |
paper-1.21.1
fabric-1.21.1
paper-1.20.1
fabric-1.20.1
distro-groups: |
paper
fabric
paper
fabric
distro-descriptions: |
Paper 1.21.1
Fabric 1.21.1
Paper 1.20.1
Fabric 1.20.1
files: |
1.21.1/target/HuskSync-Paper-${{ github.event.release.tag_name }}+mc.1.21.1.jar
1.21.1/target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.21.1.jar
1.20.1/target/HuskSync-Paper-${{ github.event.release.tag_name }}+mc.1.20.1.jar
1.20.1/target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.20.1.jar