Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Apr 16, 2023
1 parent 3dc8388 commit 21a5f23
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 37 deletions.
36 changes: 13 additions & 23 deletions .github/workflows/draftrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Install advancecomp
run: sudo apt-get install advancecomp
- name: Install strip-nondeterminism
run: sudo apt-get install strip-nondeterminism
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
env:
BUILD_RELEASE: ${{ github.event.release.prerelease == false }}
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
cache-disabled: true
arguments: build --stacktrace --warning-mode all
- name: Rezip mod .jar files to remove directory entries
run: bash removeDirectoryEntries.sh
- name: Run strip-nondeterminism on built .jar files
run: strip-nondeterminism build/libs/*.jar
- name: Run advzip (-i 99999) on built .jar files
run: advzip --shrink-insane -kzi 99999 -p build/libs/*.jar
- name: Draft release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Draft release ${{ github.ref }}
name: Draft release ${{ github.ref }}
body: Replace this text with the description of this release!
draft: true
prerelease: false
- name: Upload draft release assets
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/libs/*.jar
files: build/libs/*.jar
23 changes: 9 additions & 14 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,29 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Install advancecomp
run: sudo apt-get install advancecomp
- name: Install strip-nondeterminism
run: sudo apt-get install strip-nondeterminism
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
cache-read-only: ${{ github.ref != 'refs/heads/fabric-1.19' }}
arguments: build --stacktrace --warning-mode all
- name: Rezip mod .jar files to remove directory entries
run: bash removeDirectoryEntries.sh
- name: Run strip-nondeterminism on built .jar files
run: strip-nondeterminism build/libs/*.jar
- name: Run advzip (-i 999) on built .jar files
run: advzip --shrink-insane -kzi 999 -p build/libs/*.jar
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: Package
path: build/libs

0 comments on commit 21a5f23

Please sign in to comment.