Skip to content

Commit

Permalink
build: update CI to publish all active versions
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Sep 5, 2024
1 parent 605d314 commit 34e08b7
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 15 deletions.
43 changes: 35 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,51 @@ 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:
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:
arguments: build test publish
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
with:
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:
Expand All @@ -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
60 changes: 53 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
gradle-version: '8.8'
- name: '[Current - 1.21.1] Checkout for CI 🛎️'
uses: actions/checkout@v4
with:
arguments: build test publish
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'
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

0 comments on commit 34e08b7

Please sign in to comment.