Skip to content

Commit

Permalink
Completely refactored compat structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrix-Shen committed Jun 15, 2022
1 parent fde37bc commit 95333c9
Show file tree
Hide file tree
Showing 71 changed files with 709 additions and 1,727 deletions.
61 changes: 47 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:
jobs:
build:
if: ${{ github.event_name == 'push' && !startsWith(github.event.ref, 'refs/tags/') }}
if: ${{ github.event_name == 'push' && !startsWith(github.event.ref, 'refs/tags/') && contains(github.event.head_commit.message, '[build skip]') == false }}
strategy:
matrix:
java: [ 17 ]
Expand All @@ -28,9 +28,12 @@ jobs:
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
path: |
~/.gradle/caches
./.gradle/loom-caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle', 'gradle.properties', '**/*.accesswidener') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Get short commit sha
id: get_short_sha
Expand All @@ -55,6 +58,13 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Preprocess resources
env:
COMMIT_SHA: ${{ steps.get_short_sha.outputs.short_sha }}
BUILD_TYPE: "BETA"
BUILD_NUMBER: ${{ github.run_number }}
run: ./gradlew preprocessResources

- name: Build with Gradle
env:
COMMIT_SHA: ${{ steps.get_short_sha.outputs.short_sha }}
Expand All @@ -66,7 +76,10 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: ${{ steps.mod_name.outputs.value }} ${{ steps.mod_version.outputs.value }}.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }}
path: build/libs/
path: |
LICENSE
fabricWrapper/build/libs/*.jar
fabricWrapper/build/tmp/submods/META-INF/jars/*.jar
- name: Create Github Release
if: contains(github.event.head_commit.message, '[publish skip]') == false && contains(github.event.ref, 'refs/heads/exp') == false
Expand All @@ -75,7 +88,8 @@ jobs:
prerelease: true
files: |
LICENSE
build/libs/*.jar
fabricWrapper/build/libs/*.jar
fabricWrapper/build/tmp/submods/META-INF/jars/*.jar
name: "[CI#${{ github.run_number}}]${{ steps.mod_name.outputs.value }} ${{ steps.mod_version.outputs.value }}.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }}"
tag_name: "CI/build.${{ github.run_number}}"
target_commitish: ${{ github.event.ref }}
Expand All @@ -101,9 +115,12 @@ jobs:
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
path: |
~/.gradle/caches
./.gradle/loom-caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle', 'gradle.properties', '**/*.accesswidener') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Get short commit sha
id: get_short_sha
Expand All @@ -128,6 +145,13 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Preprocess resources
env:
COMMIT_SHA: ${{ steps.get_short_sha.outputs.short_sha }}
BUILD_TYPE: "RELEASE"
BUILD_NUMBER: ${{ github.run_number }}
run: ./gradlew preprocessResources

- name: Build with Gradle
env:
COMMIT_SHA: ${{ steps.get_short_sha.outputs.short_sha }}
Expand All @@ -139,13 +163,19 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: ${{ steps.mod_name.outputs.value }} ${{ steps.mod_version.outputs.value }}.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }}
path: build/libs/
path: |
LICENSE
fabricWrapper/build/libs/*.jar
fabricWrapper/build/tmp/submods/META-INF/jars/*.jar
- name: Upload assets to GitHub Release
uses: AButler/[email protected]
- name: Upload assets to Github Release
uses: softprops/action-gh-release@v1
with:
files: 'build/libs/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
files: |
LICENSE
fabricWrapper/build/libs/*.jar
fabricWrapper/build/tmp/submods/META-INF/jars/*.jar
tag_name: ${{ github.event.ref }}

pull_request:
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -168,5 +198,8 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Preprocess resources
run: ./gradlew preprocessResources

- name: Build with Gradle
run: ./gradlew build
Loading

0 comments on commit 95333c9

Please sign in to comment.