From e8a301b4d1f628c5235d783094065a01c76f45a0 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov <38042667+CommanderTvis@users.noreply.github.com> Date: Thu, 10 Mar 2022 22:17:00 +0700 Subject: [PATCH 1/3] Create publish.yml --- .github/workflows/publish.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..74a385e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Gradle publish + +on: + workflow_dispatch: + release: + types: [ created ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Run a one-line script + run: echo Hello, world! + + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. -- 2.34.1 From 22e6657e794dfec38de91679e159f44188dbcde2 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Thu, 10 Mar 2022 22:25:17 +0700 Subject: [PATCH 2/3] Write GitHub Actions scripts --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++ .github/workflows/publish.yml | 28 +++++++++++++++------- gradle.properties | 1 + gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 gradle.properties diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..943d0ac --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: Gradle build + +on: + push: + branches: [ dev, master ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 40 + + steps: + - uses: actions/checkout@v2 + - uses: DeLaGuardo/setup-graalvm@5.0 + with: + graalvm: 22.0.0.2 + java: java11 + arch: amd64 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} + restore-keys: | + ${{ runner.os }}-gradle- + - uses: gradle/wrapper-validation-action@v1.0.4 + - name: Build + run: ./gradlew build --build-cache --no-daemon --stacktrace diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 74a385e..fb3d188 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,14 +8,26 @@ on: jobs: build: runs-on: ubuntu-latest + timeout-minutes: 40 steps: - uses: actions/checkout@v2 - - - name: Run a one-line script - run: echo Hello, world! - - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. + - uses: DeLaGuardo/setup-graalvm@5.0 + with: + graalvm: 22.0.0.2 + java: java11 + arch: amd64 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} + restore-keys: | + ${{ runner.os }}-gradle- + - uses: gradle/wrapper-validation-action@v1.0.4 + - name: Publish artifacts + run: > + ./gradlew publishAllPublicationsToSpaceRepository --no-daemon --build-cache + -Ppublishing.space.user=${{ secrets.SPACE_APP_ID }} + -Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..7fc6f1f --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +kotlin.code.style=official diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87..00e33ed 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -- 2.34.1 From b150fd5fd3d92f942b68fe5795485cb8dadedf41 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Wed, 16 Mar 2022 02:31:44 +0700 Subject: [PATCH 3/3] Use standard workflow actions for Java, Gradle --- .github/workflows/build.yml | 19 +++++-------------- .github/workflows/publish.yml | 21 ++++++--------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 943d0ac..5347757 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,19 +12,10 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: DeLaGuardo/setup-graalvm@5.0 + - uses: actions/setup-java@v2.5.0 with: - graalvm: 22.0.0.2 - java: java11 - arch: amd64 - - uses: actions/cache@v2 + java-version: 11 + distribution: liberica + - uses: gradle/gradle-build-action@v2 with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- - - uses: gradle/wrapper-validation-action@v1.0.4 - - name: Build - run: ./gradlew build --build-cache --no-daemon --stacktrace + arguments: build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fb3d188..0576154 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,22 +12,13 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: DeLaGuardo/setup-graalvm@5.0 + - uses: actions/setup-java@v2.5.0 with: - graalvm: 22.0.0.2 - java: java11 - arch: amd64 - - uses: actions/cache@v2 + java-version: 11 + distribution: liberica + - uses: gradle/gradle-build-action@v2 with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- - - uses: gradle/wrapper-validation-action@v1.0.4 - - name: Publish artifacts - run: > - ./gradlew publishAllPublicationsToSpaceRepository --no-daemon --build-cache + arguments: | + publishAllPublicationsToSpaceRepository -Ppublishing.space.user=${{ secrets.SPACE_APP_ID }} -Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }} -- 2.34.1