-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Kiolk/dev
Added pipelines for automate work
- Loading branch information
Showing
8 changed files
with
297 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Create Github Release | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
permissions: | ||
contents: write | ||
jobs: | ||
check_version: | ||
name: Read release version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
versionName: ${{ steps.readVersion.outputs.VERSION_NAME }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Read file and store value in variable | ||
id: readVersion | ||
run: | | ||
MY_VERSION=$(grep '^versionName' gradle.properties | cut -d'=' -f2) | ||
echo "Version name from gradle.properties: $MY_VERSION" | ||
echo "VERSION_NAME=$MY_VERSION" >> "$GITHUB_OUTPUT" | ||
shell: bash | ||
|
||
generate_release: | ||
name: Generate Github release | ||
needs: check_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 17 | ||
distribution: 'zulu' | ||
- name: Setup variables in local.properties | ||
run: | | ||
echo "signing_keyId=${{secrets.SIGNING_KEY_ID}}" > local.properties | ||
echo "signing_password=${{secrets.SIGNING_PASSWORD}}" >> local.properties | ||
echo "username=${{secrets.MAVEN_CENTRAL_USER_NAME}}" >> local.properties | ||
echo "password=${{secrets.MAVEN_CENTRAL_PASSWORD}}" >> local.properties | ||
- name: Setup gpg private key | ||
run: | | ||
echo "${{secrets.GPG_PRIVATE_KEY}}" > maven-secret-key.asc | ||
- name: Generate jar | ||
run: | | ||
./gradlew jar | ||
echo ${{ needs.check_version.outputs.versionName }} | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ needs.check_version.outputs.versionName }} | ||
replacesArtifacts: true | ||
artifacts: build/libs/detekt-rules.jar | ||
skipIfReleaseExists: true | ||
generateReleaseNotes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish to Maven Central Repository | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
jobs: | ||
build: | ||
name: Publish to Maven Central Repository | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 17 | ||
distribution: 'zulu' | ||
- name: Setup variables in local.properties | ||
run: | | ||
echo "signing_keyId=${{secrets.SIGNING_KEY_ID}}" > local.properties | ||
echo "signing_password=${{secrets.SIGNING_PASSWORD}}" >> local.properties | ||
echo "username=${{secrets.MAVEN_CENTRAL_USER_NAME}}" >> local.properties | ||
echo "password=${{secrets.MAVEN_CENTRAL_PASSWORD}}" >> local.properties | ||
- name: Setup gpg private key | ||
run: | | ||
echo "${{secrets.GPG_PRIVATE_KEY}}" > maven-secret-key.asc | ||
- name: Publish to new Maven Central Repository | ||
run: | | ||
./gradlew publishAllPublicationsToCentralPortal | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Code checks on Pull Request | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- 'master' | ||
- 'release/**' | ||
- 'dev' | ||
jobs: | ||
pull_request_checks: | ||
name: Code checks on Pull Request | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 17 | ||
distribution: 'zulu' | ||
- name: Setup variables in local.properties | ||
run: | | ||
echo "signing_keyId=${{secrets.SIGNING_KEY_ID}}" > local.properties | ||
echo "signing_password=${{secrets.SIGNING_PASSWORD}}" >> local.properties | ||
echo "username=${{secrets.MAVEN_CENTRAL_USER_NAME}}" >> local.properties | ||
echo "password=${{secrets.MAVEN_CENTRAL_PASSWORD}}" >> local.properties | ||
- name: Setup gpg private key | ||
run: | | ||
echo "${{secrets.GPG_PRIVATE_KEY}}" > maven-secret-key.asc | ||
- name: Run unit tests | ||
run: ./gradlew test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,7 @@ bin/ | |
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store | ||
.DS_Store | ||
|
||
/local.properties | ||
/maven-secret-key.asc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[![](https://jitpack.io/v/Kiolk/Detekt-rules.svg)](https://jitpack.io/#Kiolk/Detekt-rules) ![Maven Central Version](https://img.shields.io/maven-central/v/io.github.kiolk/kiolk-detekt-rules) ![GitHub Release](https://img.shields.io/github/v/release/kiolk/detekt-rules?color=yellow) | ||
|
||
# kiolk-detekt-rules | ||
|
||
--- | ||
Hello folks. This repository contains my own Detekt rules that born in result my work how developer. I am planning to add new rules in the future. You are welcome to contribute! | ||
|
||
|
||
# How add to the project | ||
|
||
--- | ||
You have different options how you can add this set of rules to your project. | ||
|
||
## Maven | ||
To use Maven Central repository, you should add link on `mavenCentral()` in repositories block in `build.gradle.kt` file | ||
|
||
```kotlin | ||
repositories { | ||
mavenCentral() | ||
} | ||
``` | ||
In `dependencies` block in `build.gradle.kt` of module where you will use detekt add reference on library that points on the latest version | ||
```kotlin | ||
detektPlugins("io.github.kiolk:kiolk-detekt-rules:1.0.4") | ||
``` | ||
|
||
## Jitpack | ||
To use Jitpack, you should add link on jitpack in repositories block in `build.gradle.kt` file | ||
|
||
```kotlin | ||
repositories { | ||
maven { url 'https://jitpack.io' } | ||
} | ||
``` | ||
In `dependencies` block in `build.gradle.kt` of module where you will use detekt add reference on library that points on the latest version | ||
```kotlin | ||
detektPlugins("com.github.Kiolk:Detekt-rules:v1.0.4") | ||
``` | ||
|
||
## Local artifacts | ||
If you want to use only locally, you should add path to `jar` file on your local machine. Latest artifacts you can find in [release section](https://github.com/Kiolk/Detekt-rules/releases) of repository. | ||
```kotlin | ||
detektPlugins(files("local_path_to_artifact.jar")) | ||
|
||
``` | ||
|
||
# Configuration | ||
|
||
--- | ||
|
||
# Rules: | ||
|
||
--- | ||
|
||
## UseInvokeForOperator | ||
### Motivation | ||
### Cases | ||
### AutoCorrection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
kotlin.code.style=official | ||
|
||
versionName=1.0.4 | ||
pomGroupId=io.github.kiolk | ||
pomDescription=Detekt rules | ||
pomUrl=https://github.com/Kiolk/Detekt-rules | ||
pomScmUrl=https://github.com/Kiolk/Detekt-rules | ||
pomScmConnection=scm:[email protected]:Kiolk/Detekt-rules.git | ||
pomScmDevConnection=scm:[email protected]:Kiolk/Detekt-rules.git | ||
pomLicenseName=The MIT License | ||
pomLicenseUrl=https://opensource.org/licenses/MIT | ||
pomLicenseDist=repo | ||
pomDeveloperId=kiolk | ||
pomDeveloperName=Yauheni Slizh | ||
pomArtifactId=kiolk-detekt-rules | ||
pomName=Kiolk Detekt Rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters