From 04da3001161a1389b3878c60cc52e66042eec2fd Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Fri, 22 Jul 2022 22:21:01 +0900 Subject: new: various workflow optimizations (#62) * new: cache gradle files in workflows * fix: remove setup-java caching and cache prebundled-jars in release workflow * use secret for easier updating later Co-authored-by: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> --- .github/workflows/build.yml | 12 +++++++++++- .github/workflows/release.yml | 16 +++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62816b1..e773d76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,17 @@ jobs: with: java-version: 17 distribution: temurin - cache: gradle + + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + **/loom-cache + **/prebundled-jars + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Chmod Gradle run: chmod +x ./gradlew diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2c7bb7..2f79a05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,13 +29,23 @@ jobs: with: java-version: 17 distribution: temurin - cache: gradle + + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + **/loom-cache + **/prebundled-jars + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Chmod Gradle run: chmod +x ./gradlew - name: Get version number - run: echo '::set-output name=VERSION_NUMBER::$((47 + ${{ github.run_number }}))' + run: echo '::set-output name=VERSION_NUMBER::$(( ${{ secrets.BUILD_OFFSET }} + ${{ github.run_number }}))' id: version - name: Publish @@ -45,4 +55,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: oneconfig-artifacts - path: versions/**/build/libs/ \ No newline at end of file + path: versions/**/build/libs/ -- cgit