fix: fixed build.yml????????

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2023-08-05 01:55:59 +02:00
parent c4b00aa9a5
commit 9273b4b168

View file

@ -1,21 +1,46 @@
on: [ push ] on: [ push ]
jobs: jobs:
build_and_publish: build:
runs-on: docker name: Build
container: runs-on: ubuntu-latest
image: gradle
steps: steps:
- name: Checkout project sources - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v2
- name: Clean Caches
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
- name: Build with Gradle
run: | run: |
rm -f .gradle/caches/modules-2/modules-2.lock ./gradlew clean
rm -fr .gradle/caches/*/plugin-resolution/ ./gradlew shadowJar
- name: Export Gradle User Home env:
uses: export GRADLE_USER_HOME=`pwd`/.gradle GRADLE_OPTS: "-Dorg.gradle.daemon=false"
- name: Setup Gradle GRADLE_USER_HOME: ${{ github.workspace }}/.gradle
uses: gradle/gradle-build-action@v2 GIT_SUBMODULE_STRATEGY: recursive
- name: Run shadowJar working-directory: ${{ github.workspace }}
run: gradle shadowJar
- name: Run publish publish:
run: gradle publish name: Publish
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
- name: Publish with Gradle
run: |
./gradlew publish
env:
GRADLE_USER_HOME: ${{ github.workspace }}/.gradle
GIT_SUBMODULE_STRATEGY: recursive
working-directory: ${{ github.workspace }}