chore: fix readme parsing #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI - Build Release | |
on: | |
push: | |
branches: | |
- main | |
- "[0-9]+.[0-9]+/main" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: | | |
!contains(github.event.head_commit.message, '[ciskip]') | |
steps: | |
- name: Clone project | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "microsoft" | |
java-version: 21 | |
- name: Fix borked permissions | |
run: chmod +x ./gradlew | |
- name: Get minecraft version | |
run: | | |
export MC_VERSION=$(grep ^minecraft_version= ./gradle.properties | cut -d= -f2) | |
if [ -z "$MC_VERSION" ]; then | |
echo "Could not find minecraft_version in gradle.properties" | |
exit 1 | |
fi | |
echo "$MC_VERSION" >> GITHUB_ENV | |
echo "Minecraft version is $MC_VERSION" | |
- name: Pull meta data | |
env: | |
MC_VERSION: ${{ env.MC_VERSION }} | |
# Get the latest hash from the API for this mc version or default to the first commit on this branch | |
run: | | |
export LAST_HASH=$(curl https://api.feed-the-beast.com/v1/meta/versions/mods/ftb-promoter/${MC_VERSION} | jq -r -e .hash) | |
if [ -z "$LAST_HASH" ] || [ "$LAST_HASH" == "null" ]; then | |
echo "No hash found for $MC_VERSION, defaulting to first commit on this branch" | |
export LAST_HASH=$(git rev-list --max-parents=0 HEAD) | |
fi | |
echo "Last hash is $LAST_HASH" | |
git log --format=full $LAST_HASH..HEAD > COMMIT_HISTORY | |
- name: Download FTB Worlds | |
run: | | |
mkdir -p libs | |
curl -o libs/rgp_client-1.0.6.jar https://cdn.feed-the-beast.com/ephemeral/rgp_client-1.0.6.jar | |
- name: Setup Gradle and Validate Wrapper | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-read-only: false | |
- name: Run gradle tasks | |
run: ./gradlew build publishMods publish | |
env: | |
BUILD_NUMBER: ${{ github.run_number }} | |
FTB_MAVEN_TOKEN: ${{ secrets.FTB_MAVEN_TOKEN }} | |
CURSEFORGE_KEY: ${{ secrets.CURSEFORGE_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update Meta info | |
# Get the current commit hash and push it against the minecraft version | |
env: | |
MC_VERSION: ${{ env.MC_VERSION }} | |
run: | | |
export CURRENT_HASH=$(git rev-parse HEAD) | |
echo "Pushing hash $CURRENT_HASH to $MC_VERSION" | |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.META_TOKEN }}" -d "{\"hash\":\"$CURRENT_HASH\"}" https://api.feed-the-beast.com/v1/meta/versions/mods/ftb-promoter/$MC_VERSION |