mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-10-26 14:24:57 +00:00
Move to unified build script
This commit is contained in:
1 parent
e65ef4e408
commit
81b0e9f0fd
86 files changed
+904
-203
No files matched your search
@@ -0,0 +1,10 @@
|
||||
if [ ! -z $(git diff --name-only HEAD HEAD~1 | grep build.gradle) ]; then
|
||||
new_version="$(git log -n1 --format=format:"%H")"
|
||||
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
|
||||
echo "Updated buildscript version to $new_version";
|
||||
else
|
||||
echo "Ignored buildscript version update: no changes detected"
|
||||
fi
|
||||
@@ -0,0 +1,24 @@
|
||||
# This workflow only meant for the source mod you shouldn't bring it into your own project
|
||||
|
||||
name: Buildscript maintenance
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
|
||||
jobs:
|
||||
buildscript-maintenance:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: setup git config
|
||||
run: |
|
||||
git config user.name "GitHub CI Bot"
|
||||
git config user.email "<>"
|
||||
|
||||
- name: Ensure build script version is up to date
|
||||
run: .github/scripts/update-version.sh
|
||||
@@ -0,0 +1,71 @@
|
||||
# This workflow only meant for the source mod you shouldn't bring it into your own project
|
||||
|
||||
name: Release packages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
|
||||
jobs:
|
||||
zip-packages:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Zip starter
|
||||
uses: montudor/action-zip@v1
|
||||
with:
|
||||
args: >
|
||||
zip -r starter.zip . \
|
||||
\
|
||||
-x "*.git/*" \
|
||||
\
|
||||
-x ".github/scripts/update-version.sh" \
|
||||
-x ".github/workflows/buildscript-maintenance.yml" \
|
||||
-x ".github/workflows/package-release.yml" \
|
||||
\
|
||||
-x "*docs/*" \
|
||||
-x "README.md" \
|
||||
-x "LICENSE" \
|
||||
\
|
||||
-x "starter.zip" \
|
||||
-x "migration.zip"
|
||||
|
||||
- name: Publish starter package
|
||||
uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "latest-stater"
|
||||
prerelease: true
|
||||
title: "Latest starter package"
|
||||
files: "starter.zip"
|
||||
|
||||
- name: Zip migration
|
||||
uses: montudor/action-zip@v1
|
||||
with:
|
||||
args: >
|
||||
zip -r migration.zip . \
|
||||
\
|
||||
-x "*.git/*" \
|
||||
\
|
||||
-x ".github/scripts/update-version.sh" \
|
||||
-x ".github/workflows/buildscript-maintenance.yml" \
|
||||
-x ".github/workflows/package-release.yml" \
|
||||
\
|
||||
-x "*docs/*" \
|
||||
-x "*src/*" \
|
||||
-x "LICENSE" \
|
||||
-x "README.md" \
|
||||
\
|
||||
-x "starter.zip" \
|
||||
-x "migration.zip"
|
||||
|
||||
- name: Publish migration package
|
||||
uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "latest-migration"
|
||||
prerelease: true
|
||||
title: "Latest migration package"
|
||||
files: "migration.zip"
|
||||
@@ -0,0 +1,32 @@
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Build pull request
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Setup the workspace
|
||||
run: ./gradlew setupCIWorkspace
|
||||
|
||||
- name: Build the mod
|
||||
run: ./gradlew build
|
||||
@@ -0,0 +1,41 @@
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Build and release main branch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Setup the workspace
|
||||
run: ./gradlew setupCIWorkspace
|
||||
|
||||
- name: Build the mod
|
||||
run: ./gradlew build
|
||||
|
||||
- uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "latest"
|
||||
prerelease: true
|
||||
title: "Latest Development Build"
|
||||
files: build/libs/*.jar
|
||||
|
||||
Reference in new issue
Block a user