Skip to content

Bug fixes and 1.20.4 release prep #186

Bug fixes and 1.20.4 release prep

Bug fixes and 1.20.4 release prep #186

name: Verify pull requests
on:
pull_request:
branches:
- main
- main/**
- feature/**
jobs:
style_check:
name: Style/Format check
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Commit Linter
uses: wagoid/commitlint-github-action@v5
with:
configFile: .github/commitlint.config.js
build_test:
name: Build and Test
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout git repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Extract commit info
id: commit_info
run: |
short_sha="$(git rev-parse --short $GITHUB_SHA)"
branch_name="pr$(echo $GITHUB_REF | sed -e 's/refs\/pull\/\(.*\)\/merge/\1/')"
echo "short_sha=$short_sha" >> $GITHUB_OUTPUT
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
# Install python and deps
- name: Set up Python 3.12.1
uses: actions/setup-python@v4
with:
python-version: 3.12.1
- name: Cache PIP packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.github/requirements.txt') }}
- name: Install python deps
run: |
python -m pip install --upgrade pip
python -m pip install -r .github/requirements.txt
- name: Generate version
id: versioning
run: |
version=$(python .github/git_utils.py genVersion --format_str="{major}.{minor}.{patch}-${{ steps.commit_info.outputs.branch_name }}+{increment}")
echo "version=$version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle2-${{ hashFiles('**/build.gradle', '**/build.properties', '**/gradle.properties', '**/gradle-wrapper.properties') }}
- name: Build with Gradle
run: ./gradlew build # TODO test
env:
AUTO_GENERATED_VERSION: ${{ steps.versioning.outputs.version }}
- name: Cleanup Gradle Cache
# These files shouldn't be cached according to https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: project-red-${{ steps.versioning.outputs.version }}
path: '*/build/libs/ProjectRed-*.jar'
- name: TEST curseforgepy
continue-on-error: true
run: |
COMMON_ARGS=( \
-k $CURSE_TOKEN \
-rt $CURSE_RELEASE_TYPE \
-v 'Java 17' \
-v 1.20.4 \
-v NeoForge \
-c ./CHANGELOG.md \
--dryrun \
)
MODULE_ARGS=(
$COMMON_ARGS \
--required-dep project-red-core \
)
echo "commons $COMMON_ARGS"
echo "modules $MODULE_ARGS"
python -m curseuploadpy $COMMON_ARGS -p 228702 -f core/build/libs/*-core.jar -rd codechicken-lib-1-8 -rd cb-multipart
python -m curseuploadpy $MODULE_ARGS -p 229048 -f expansion/build/libs/*-expansion.jar
python -m curseuploadpy $MODULE_ARGS -p 229049 -f exploration/build/libs/*-exploration.jar
python -m curseuploadpy $MODULE_ARGS -p 230111 -f fabrication/build/libs/*-fabrication.jar -rd project-red-integration -rd project-red-transmission
python -m curseuploadpy $MODULE_ARGS -p 229046 -f illumination/build/libs/*-illumination.jar
python -m curseuploadpy $MODULE_ARGS -p 229045 -f integration/build/libs/*-integration.jar
python -m curseuploadpy $MODULE_ARGS -p 478939 -f transmission/build/libs/*-transmission.jar
env:
CURSE_RELEASE_TYPE: alpha
CURSE_TOKEN: ${{ secrets.CURSE_TOKEN }}