Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Dec 1, 2024
1 parent cff51af commit f7d6328
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,26 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
- name: Setup Java
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV"

- name: Loom Cache
uses: actions/cache@v4
with:
path: "**/.gradle/loom-cache"
key: "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}"
restore-keys: "${{ runner.os }}-gradle-"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
java-version: '17'
distribution: temurin
cache: gradle
gradle-home-cache-cleanup: true
cache-read-only: ${{ !endsWith(github.ref_name, '/dev') }}

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v2

- name: Build & Publish to Maven
env:
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
run: ./gradlew build publish
run: ./gradlew build publish
35 changes: 20 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,34 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
RELEASE_BUILD: true
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
PLATFORM: ${{ inputs.platform }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
- name: Setup Java
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV"

- name: Loom Cache
uses: actions/cache@v4
with:
java-version: '17'
distribution: temurin
cache: gradle
path: "**/.gradle/loom-cache"
key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}"
restore-keys: "${{ runner.os }}-gradle-"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
cache-read-only: true

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v2

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build & Publish
env:
RELEASE_BUILD: true
PLATFORM: ${{ inputs.platform }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
run: ./gradlew numismaticsPublish

0 comments on commit f7d6328

Please sign in to comment.