forked from Radu-Voinea/Utils
-
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.
- Loading branch information
0 parents
commit d4458b7
Showing
76 changed files
with
4,275 additions
and
0 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,136 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
workflow_run: | ||
workflows: [ "Patch Version" ] | ||
types: | ||
- completed | ||
|
||
|
||
jobs: | ||
increment-version: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
# ==================== SETUPS ==================== | ||
|
||
- name: Checkout Codebase | ||
uses: actions/checkout@v4 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: Setup Python | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: zulu | ||
java-version: 21 | ||
|
||
# ==================== INCREMENT VERSION ===================== | ||
|
||
- name: Increment Version | ||
run: | | ||
python3 scripts/increment_version.py | ||
# ==================== PUBLISH ==================== | ||
|
||
- name: Commit to Repository | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Incremented patch version | ||
commit_options: '--no-verify --signoff' | ||
commit_user_name: Voinea Radu | ||
commit_user_email: [email protected] | ||
|
||
build: | ||
needs: increment-version | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
# ==================== SETUPS ==================== | ||
|
||
- name: Checkout Codebase | ||
uses: actions/checkout@v4 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: Setup Python | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: zulu | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | ||
build-scan-terms-of-use-agree: "yes" | ||
|
||
# ==================== BUILD ==================== | ||
|
||
- name: Export Credentials | ||
run: | | ||
mkdir -p ~/.gradle | ||
echo " | ||
voinearadu.url=https://repository.voinearadu.com/repository/maven-releases/ | ||
voinearadu.auth.username=admin | ||
voinearaduauth.password=${{ secrets.NEXUS_PASSWORD }} | ||
" > ~/.gradle/gradle.properties | ||
- name: Cache Gradle Dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle | ||
restore-keys: | | ||
${{ runner.os }}-gradle | ||
- name: Set gradle permissions | ||
run: chmod +x gradlew | ||
|
||
- name: Execute Gradle Build | ||
run: ./gradlew build | ||
|
||
# ==================== ENVIRONMENT VARIABLES ==================== | ||
|
||
- name: External scripts - Environment Variables | ||
run: | | ||
echo "VERSION=$(./gradlew properties -q | grep "^version:" | awk '{print $2}')" >> $GITHUB_ENV | ||
echo "ARTIFACT=$(./gradlew properties -q | grep "^name:" | awk '{print $2}')" >> $GITHUB_ENV | ||
echo "GROUP=$(./gradlew properties -q | grep "^group:" | awk '{print $2}')" >> $GITHUB_ENV | ||
echo "REPOSITORY_NAME=$(echo $REPOSITORY_NAME | awk -F'/' '{print $2}')" >> $GITHUB_ENV | ||
# ==================== PUBLISH ==================== | ||
|
||
- name: Execute Gradle Publish | ||
run: ./gradlew publish | ||
|
||
- name: Automatic Releases | ||
uses: marvinpinto/[email protected] | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "${{ env.VERSION }}" | ||
prerelease: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }} | ||
title: "${{ env.VERSION }}" | ||
files: | | ||
build/libs/*.jar | ||
src/*/build/libs/*.jar | ||
src/*/*/build/libs/*.jar | ||
src/*/*/*/build/libs/*.jar |
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,32 @@ | ||
### IntelliJ IDEA ### | ||
.idea/ | ||
*.iml | ||
|
||
### Gradle ### | ||
.gradle/ | ||
build/ | ||
|
||
### Groovy ### | ||
lib | ||
|
||
### Python ### | ||
venv | ||
|
||
### Temporary Files ### | ||
tmp/ | ||
tmp-* | ||
py.log | ||
*.log | ||
test_workflow.sh | ||
__pycache__/ | ||
scripts/libs/__pycache__/ | ||
scripts/libs/commands/__pycache__/ | ||
|
||
### Build Files ### | ||
|
||
### Credentrials Files ### | ||
scripts/credentials.py | ||
/config/ | ||
http.key | ||
id.rsa | ||
digital_ocean.token |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Voinea Radu-Mihai | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,17 @@ | ||
# Logger | ||
|
||
## How to add to your project | ||
|
||
```kotlin | ||
repositories { | ||
maven("https://repository.voinearadu.com/repository/maven-releases/") | ||
maven("https://repo.voinearadu.com/") // The short version of the above (might be slower on high latency connections) | ||
} | ||
|
||
dependencies { | ||
implementation("com.voinearadu:utils:VERSION") | ||
|
||
// To use the redis_manager | ||
implementation("redis.clients:jedis:<JEDIS_VERSION>") | ||
} | ||
``` |
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,73 @@ | ||
plugins { | ||
id("java") | ||
id("java-library") | ||
id("maven-publish") | ||
} | ||
|
||
val _group = libs.versions.group.get() | ||
val _version = libs.versions.version.get() | ||
|
||
group = _group | ||
version = _version | ||
|
||
repositories { | ||
mavenCentral() | ||
maven("https://repository.voinearadu.dev/repository/maven-releases/") | ||
} | ||
|
||
dependencies { | ||
// Dependencies | ||
api(libs.gson) | ||
api(libs.slf4j) | ||
api(libs.apache.commons.compress) | ||
api(libs.apache.commons.lang3) | ||
api(libs.apache.commons.pool2) | ||
api(libs.apache.commons.io) | ||
compileOnly(libs.jedis) | ||
testImplementation(libs.jedis) | ||
|
||
// Annotations | ||
compileOnly("org.projectlombok:lombok:1.18.34") | ||
annotationProcessor("org.projectlombok:lombok:1.18.34") | ||
testCompileOnly("org.projectlombok:lombok:1.18.34") | ||
testAnnotationProcessor("org.projectlombok:lombok:1.18.34") | ||
|
||
compileOnly("org.jetbrains:annotations:24.1.0") | ||
annotationProcessor("org.jetbrains:annotations:24.1.0") | ||
testCompileOnly("org.jetbrains:annotations:24.1.0") | ||
testAnnotationProcessor("org.jetbrains:annotations:24.1.0") | ||
|
||
// Tests | ||
testImplementation(platform(libs.junit.bom)) | ||
testImplementation(libs.junit.jupiter) | ||
} | ||
|
||
tasks { | ||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") | ||
} | ||
|
||
repositories { | ||
maven(url = (project.findProperty("voinearadu.url") ?: "") as String) { | ||
credentials(PasswordCredentials::class) { | ||
username = (project.findProperty("voinearadu.auth.username") ?: "") as String | ||
password = (project.findProperty("voinearadu.auth.password") ?: "") as String | ||
} | ||
} | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events("passed", "skipped", "failed") | ||
} | ||
} | ||
} | ||
|
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,26 @@ | ||
[versions] | ||
version = "1.0.0" | ||
group = "com.voinearadu" | ||
|
||
[plugins] | ||
shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" } | ||
|
||
[libraries] | ||
# Testing | ||
junit_jupiter = { module = "org.junit.jupiter:junit-jupiter ", version = "5.11.0" } | ||
junit_bom = { module = "org.junit:junit-bom", version = "5.11.0" } | ||
|
||
# Annotations | ||
lombok = { module = "org.projectlombok:lombok", version = "1.18.34" } | ||
jetbrains_annotations = { module = "org.jetbrains:annotations", version = "24.1.0" } | ||
|
||
# Dependencies | ||
gson = { module = "com.google.code.gson:gson", version = "2.11.0" } | ||
jedis = { module = "redis.clients:jedis", version = "5.1.5" } | ||
slf4j = { module = "org.slf4j:slf4j-api", version = "2.0.16" } | ||
apache_commons_compress = { module = "org.apache.commons:commons-compress", version = "1.27.1" } | ||
apache_commons_lang3 = { module = "org.apache.commons:commons-lang3", version = "3.16.0" } | ||
apache_commons_pool2 = { module = "org.apache.commons:commons-pool2", version = "2.12.0" } | ||
apache_commons_io = { module = "commons-io:commons-io", version = "2.16.1" } | ||
|
||
|
Binary file not shown.
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,6 @@ | ||
#Thu Sep 05 05:14:33 EEST 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.