-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from Discreater/1.7.10-dev
[1.7.10] Migrate gradle build system
- Loading branch information
Showing
116 changed files
with
3,409 additions
and
2,534 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
* text eol=lf | ||
|
||
*.[jJ][aA][rR] binary | ||
|
||
*.[pP][nN][gG] binary | ||
*.[jJ][pP][gG] binary | ||
*.[jJ][pP][eE][gG] binary | ||
*.[gG][iI][fF] binary | ||
*.[tT][iI][fF] binary | ||
*.[tT][iI][fF][fF] binary | ||
*.[iI][cC][oO] binary | ||
*.[sS][vV][gG] text | ||
*.[eE][pP][sS] binary | ||
*.[xX][cC][fF] binary | ||
|
||
*.[kK][aA][rR] binary | ||
*.[mM]4[aA] binary | ||
*.[mM][iI][dD] binary | ||
*.[mM][iI][dD][iI] binary | ||
*.[mM][pP]3 binary | ||
*.[oO][gG][gG] binary | ||
*.[rR][aA] binary | ||
|
||
*.7[zZ] binary | ||
*.[gG][zZ] binary | ||
*.[tT][aA][rR] binary | ||
*.[tT][gG][zZ] binary | ||
*.[zZ][iI][pP] binary | ||
|
||
*.[tT][cC][nN] binary | ||
*.[sS][oO] binary | ||
*.[dD][lL][lL] binary | ||
*.[dD][yY][lL][iI][bB] binary | ||
*.[pP][sS][dD] binary | ||
*.[tT][tT][fF] binary | ||
*.[oO][tT][fF] binary | ||
|
||
*.[pP][aA][tT][cC][hH] -text | ||
|
||
*.[bB][aA][tT] text eol=crlf | ||
*.[cC][mM][dD] text eol=crlf | ||
*.[pP][sS]1 text eol=crlf | ||
|
||
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
if ! git diff --name-only HEAD HEAD~1 | grep -qF 'build.gradle'; then | ||
new_version="$(date +%s)" | ||
sed --in-place "s!^//version:.*!//version: $new_version!g" build.gradle | ||
git add build.gradle | ||
git commit -m "[ci skip] update build script version to $new_version" | ||
git push | ||
printf 'Updated buildscript version to %s\n' "$new_version" | ||
else | ||
printf 'Ignored buildscript version update: no changes detected\n' | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
name: Build and test | ||
|
||
on: | ||
pull_request: | ||
branches: [ 1.7.10, 1.7.10-dev ] | ||
push: | ||
branches: [ 1.7.10, 1.7.10-dev ] | ||
|
||
jobs: | ||
build-and-test: | ||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
name: Release tagged build | ||
|
||
on: | ||
push: | ||
tags: [ '*' ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout mod repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 32 | ||
|
||
- name: Set release version | ||
run: | | ||
IFS='-' read -r mv pv <<< "${GITHUB_REF#refs/*/}" | ||
echo "MC_VERSION=${mv}" >> $GITHUB_ENV | ||
echo "RELEASE_VERSION=${pv}" >> $GITHUB_ENV | ||
echo "VERSION=${pv}" >> $GITHUB_ENV | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Setup the workspace | ||
run: ./gradlew --info --stacktrace ${{ inputs.workspace }} | ||
|
||
- name: Build the mod | ||
run: ./gradlew --info --stacktrace build | ||
|
||
# Continue on error in the following steps to make sure releases still get made even if one of the methods fails | ||
|
||
- name: Delete old release if it already exists | ||
run: gh release delete --yes "${MC_VERSION}-${RELEASE_VERSION}" | ||
continue-on-error: true | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Release under current tag | ||
run: | | ||
export "CHANGELOG_FILE=$(mktemp --suffix=.md)" | ||
echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV | ||
gh api --method POST -H "Accept: application/vnd.github+json" \ | ||
"/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \ | ||
-f tag_name="${MC_VERSION}-${RELEASE_VERSION}" \ | ||
--jq ".body" > "${CHANGELOG_FILE}" | ||
cat "${CHANGELOG_FILE}" | ||
gh release create "${MC_VERSION}-${RELEASE_VERSION}" -F "${CHANGELOG_FILE}" ./build/libs/*.jar | ||
shell: bash | ||
continue-on-error: true | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to Maven, Modrinth and CurseForge | ||
run: ./gradlew --info --stacktrace build publish | ||
continue-on-error: true | ||
env: | ||
MAVEN_USER: ${{ secrets.MAVEN_USER }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} | ||
if: ${{ env.MAVEN_USER != '' }} |
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
Oops, something went wrong.