Skip to content

Commit

Permalink
Merge pull request #7 from GTNewHorizons/fix-gha
Browse files Browse the repository at this point in the history
Fix git error in gha build
  • Loading branch information
Dream-Master authored Jul 12, 2022
2 parents d899ae1 + b1f96fc commit ab8a329
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Build and test

on:
pull_request:
branches: [ master, main ]
branches: [ master, main, '1.7.10' ]
push:
branches: [ master, main ]
branches: [ master, main, '1.7.10' ]

jobs:
build-and-test:
Expand All @@ -26,24 +26,31 @@ jobs:
fetch-depth: 0

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
run: sudo apt-get update && sudo apt-get install openjdk-8-jdk-headless && sudo update-java-alternatives -s java-1.8.0-openjdk-amd64

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build thermos
run: ./gradlew setupCauldron jar packageBundle --info
run: JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ./gradlew setupCauldron jar packageBundle --info

- name: Upload thermos artifacts
uses: actions/upload-artifact@v3
with:
name: thermos-server
path: build/distributions/*

- name: Tar failed build
if: ${{ failure() }}
run: tar -cvf failed_build.tar ./*

- name: Upload failed build
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: failed-build
path: failed_build.tar

- name: Prepare libraries for launch
run: cp -av libraries/ build/distributions/libraries

Expand All @@ -52,7 +59,7 @@ jobs:
mkdir run
cd run
echo "eula=true" > eula.txt
timeout 90 java -Xmx1G -server -jar ../build/distributions/Thermos-1.7.10-1614.*-server.jar 2>&1 | tee -a ../server.log || true
timeout 90 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xmx1G -server -jar ../build/distributions/Thermos-*-server.jar 2>&1 | tee -a ../server.log || true
- name: Test no errors reported during server run
run: |
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/release-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,20 @@ jobs:
- name: Checkout mod repo
uses: actions/checkout@v2
with:
fetch-depth: 32
fetch-depth: 0
submodules: 'recursive'

- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
run: sudo apt-get update && sudo apt-get install openjdk-8-jdk-headless && sudo update-java-alternatives -s java-1.8.0-openjdk-amd64

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build thermos
run: ./gradlew setupCauldron jar packageBundle --info
run: JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ./gradlew setupCauldron jar packageBundle --info

- name: Release under current tag
run: gh release create "${RELEASE_VERSION}" --generate-notes ./build/distributions/*
Expand Down

0 comments on commit ab8a329

Please sign in to comment.