Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ramidzkh committed Jul 7, 2024
1 parent c6ae0d9 commit 1d162db
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 35 deletions.
36 changes: 11 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Use Gradle cache for faster builds
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
distribution: microsoft
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Generate data
run: ./gradlew runData --max-workers 1
run: ./gradlew runData
- name: Build
run: ./gradlew build --max-workers 1
run: ./gradlew build
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: appmek
path: build/libs/
24 changes: 14 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,33 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
distribution: microsoft
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-disabled: true
- name: Generate data
run: ./gradlew runData --max-workers 1
run: ./gradlew runData
env:
APPMEK_VERSION: ${{ github.event.release.tag_name }}
- name: Build
run: ./gradlew build --max-workers 1
run: ./gradlew build
env:
APPMEK_VERSION: ${{ github.event.release.tag_name }}
- name: Upload Release Artifact
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: build/libs/Applied-Mekanistics-${{ github.event.release.tag_name }}.jar
tag_name: ${{ github.event.release.tag_name }}
- name: Upload to external sites
run: ./gradlew curseforge modrinth --max-workers 1
run: ./gradlew curseforge modrinth
env:
APPMEK_VERSION: ${{ github.event.release.tag_name }}
CURSEFORGE: ${{ secrets.CURSEFORGE }}
Expand Down

0 comments on commit 1d162db

Please sign in to comment.