-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH Actions: for commit and pull request
Highly based on Sodium's at https://github.com/CaffeineMC/sodium-fabric/tree/dd25399c139004e863beb8a2195b9d80b847d95c/.github/workflows
- Loading branch information
1 parent
d6f78b9
commit 8576c59
Showing
6 changed files
with
173 additions
and
86 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
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: Make Gradle Wrapper Executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
|
||
- name: Gradle Build | ||
run: ./gradlew check build | ||
|
||
- name: Capture Build Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: FluxApi-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,30 @@ | ||
name: build-pull-request | ||
on: [ pull_request ] | ||
|
||
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: Make Gradle Wrapper Executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: true | ||
|
||
- name: Gradle Build | ||
run: ./gradlew check build |
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,56 @@ | ||
name: build-release | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
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: Make Gradle Wrapper Executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: true | ||
|
||
- name: Gradle Build | ||
run: ./gradlew check build | ||
|
||
- name: Capture Build Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: FluxApi-artifacts-${{ steps.ref.outputs.branch }} | ||
path: build/libs/*.jar | ||
|
||
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in | ||
# the publishing section of your build.gradle | ||
- name: Publish to GitHub Packages | ||
run: ./gradlew publishAllPublicationsToCRMReleasesRepository | ||
env: | ||
CRMReleasesUsername: ${{ secrets.CRM_GITHUB_USER }} | ||
CRMReleasesPassword: ${{ secrets.CRM_GITHUB_PASS }} |
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,45 @@ | ||
name: build-tag | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
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: Make Gradle Wrapper Executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: true | ||
|
||
- name: Gradle Build | ||
run: ./gradlew check build | ||
|
||
- name: Capture Build Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: FluxApi-artifacts-${{ steps.ref.outputs.branch }} | ||
path: build/libs/*.jar |
This file was deleted.
Oops, something went wrong.