Skip to content

Commit

Permalink
build: improve build workflow
Browse files Browse the repository at this point in the history
This makes use of the new setup-java action and JDK 17.
Caching has been enabled for Gradle dependencies. Made
release titles more user-friendly.
  • Loading branch information
Cubxity committed Sep 30, 2021
1 parent 6936ef5 commit 4cf2966
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 16
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 16
java-version: 17
distribution: adopt
cache: "gradle"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand All @@ -25,7 +26,7 @@ jobs:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v${{ steps.vars.outputs.version }}-SNAPSHOT"
prerelease: true
title: "Development Build"
title: "Development Build (${{ steps.vars.outputs.version }})"
files: |
api/build/libs/*.jar
platforms/*/build/libs/*.jar
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 16
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 16
java-version: 17
distribution: adopt
cache: "gradle"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew shadowJar --no-daemon
- name: Set variables
id: vars
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: "UnifiedMetrics ${{ steps.vars.outputs.version }}"
files: |
api/build/libs/*.jar
platforms/*/build/libs/*.jar

0 comments on commit 4cf2966

Please sign in to comment.