generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build scripts and workflow actions
- build script change and especially workflow actions changes were based from https://github.com/CaffeineMC/sodium-fabric/tree/404151901893ad2cfdac91411b86e1e284d904c6/.github/workflows
- Loading branch information
1 parent
9c589d6
commit 99925d5
Showing
7 changed files
with
233 additions
and
201 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,38 @@ | ||
name: build-commit | ||
on: [ push ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Extract Current Branch Name | ||
shell: bash | ||
# bash pattern expansion to grab the branch name without the slashes | ||
run: ref="${GITHUB_REF#refs/heads/}" && echo "branch=${ref////-}" >> $GITHUB_OUTPUT | ||
id: ref | ||
|
||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
cache: gradle | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Gradle Build | ||
run: ./gradle build | ||
|
||
- name: Capture Build Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: simply-no-shading-artifacts-${{ steps.ref.outputs.branch }} | ||
path: build/libs/*.jar |
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,26 @@ | ||
name: build-pull-request | ||
on: [ push ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
cache: gradle | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Gradle Build | ||
run: ./gradle build |
33 changes: 22 additions & 11 deletions
33
.github/workflows/publish.yml → .github/workflows/build-release.yml
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 |
---|---|---|
@@ -1,34 +1,45 @@ | ||
name: Publish | ||
name: build-release | ||
on: | ||
release: | ||
types: [published] | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v3 | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
- name: Make gradle wrapper executable | ||
cache: gradle | ||
|
||
- name: Make Gradle Wrapper Executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Build | ||
run: ./gradlew clean -Pversion=${{ github.ref_name }} build --stacktrace | ||
- name: Upload binaries to release | ||
run: ./gradlew clean build -Pbuild.release=true | ||
|
||
- name: Upload Binaries to GitHub Release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: build/libs/* | ||
file: 'build/libs/*.jar;LICENSE' | ||
file_glob: true | ||
- uses: Kir-Antipov/[email protected] | ||
|
||
- name: Upload Binaries to Modrinth | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
modrinth-id: 9gx5Xvc5 | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
|
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,38 @@ | ||
name: build-tag | ||
on: [ push ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Extract Current Branch Name | ||
shell: bash | ||
# bash pattern expansion to grab the branch name without the slashes | ||
run: ref="${GITHUB_REF#refs/heads/}" && echo "branch=${ref////-}" >> $GITHUB_OUTPUT | ||
id: ref | ||
|
||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
cache: gradle | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Gradle Build | ||
run: ./gradlew build -Pbuild.release=true | ||
|
||
- name: Capture Build Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: simply-no-shading-artifacts-${{ steps.ref.outputs.branch }} | ||
path: build/libs/*.jar |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.