Skip to content

Commit

Permalink
feat: gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
makeevrserg committed Jul 12, 2023
1 parent 8f52e25 commit 01cc6e7
Show file tree
Hide file tree
Showing 24 changed files with 115 additions and 1,084 deletions.
52 changes: 8 additions & 44 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,11 @@ jobs:
detekt_validation:
needs: gradle_validation
uses: ./.github/workflows/detekt-validation.yml
# tests_validation:
# needs: gradle_validation
# uses: ./.github/workflows/tests-validation.yml

publish:
name: Build and upload
runs-on: ubuntu-latest
needs: [ gradle_validation, detekt_validation ]
steps:
- name: Checkout Git repo
uses: actions/checkout@v2
- uses: SebRollen/[email protected]
id: version
with:
file: 'gradle/libs.versions.toml'
field: 'versions.project-version'
- uses: SebRollen/[email protected]
id: name
with:
file: 'gradle/libs.versions.toml'
field: 'versions.project-name'
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
- name: Give gradle permission
run: chmod +x gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: shadowJar --stacktrace
- name: Create release
id: create_internal_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.actions_token }}
with:
files: |
./jars/${{ steps.name.outputs.value }}-${{ steps.version.outputs.value }}.jar
tag_name: ${{ steps.version.outputs.value }}
name: ${{ steps.name.outputs.value }} - ${{ steps.version.outputs.value }}
draft: false
prerelease: false
tests_validation:
needs: gradle_validation
uses: ./.github/workflows/tests-validation.yml
create_artifact:
needs: [ gradle_validation, detekt_validation, tests_validation ]
uses: ./.github/workflows/create-artifacts.yml
secrets:
ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "detekt-validation"
on:
workflow_call:
jobs:
build:
name: Build project with gradle
runs-on: ubuntu-latest
steps:
- name: Checkout Git repo
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
- name: Give gradle permission
run: chmod +x gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build --stacktrace
17 changes: 1 addition & 16 deletions .github/workflows/check-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,7 @@ jobs:
tests_validation:
needs: gradle_validation
uses: ./.github/workflows/tests-validation.yml

build:
name: Build project
runs-on: ubuntu-latest
needs: [ gradle_validation, detekt_validation ]
steps:
- name: Checkout Git repo
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
- name: Give gradle permission
run: chmod +x gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build --stacktrace
uses: ./.github/workflows/build-project.yml
41 changes: 41 additions & 0 deletions .github/workflows/create-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "detekt-validation"
on:
workflow_call:
secrets:
ACTIONS_TOKEN:
required: true
jobs:
publish:
name: Build and upload
runs-on: ubuntu-latest
steps:
- name: Checkout Git repo
uses: actions/checkout@v2
- uses: christian-draeger/[email protected]
id: properties
with:
path: './gradle.properties'
properties: 'makeevrserg.project.name makeevrserg.project.version.string'
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
- name: Give gradle permission
run: chmod +x gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: shadowJar --stacktrace
- name: Create release
id: create_internal_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
with:
files: |
./jars/${{ steps.properties.outputs.makeevrserg-project-name }}-${{ steps.properties.outputs.makeevrserg-project-version-string }}.jar
tag_name: ${{ steps.properties.outputs.makeevrserg-project-version-string }}
name: ${{ steps.properties.outputs.makeevrserg-project-name }} - ${{ steps.properties.outputs.makeevrserg-project-version-string }}
draft: false
prerelease: false
4 changes: 2 additions & 2 deletions .github/workflows/detekt-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.11
- name: Set up JDK 1.17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- name: Give gradle permission
run: chmod +x gradlew
- name: detekt
Expand Down
2 changes: 0 additions & 2 deletions build-logic/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions build-logic/plugins/convention/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 01cc6e7

Please sign in to comment.