Skip to content

Commit 793904b

Browse files
author
Francisco Solis
authored
Sonatype, JitPack, Kotlin DSL & Updates (#35)
* Updated to gradle kotlin dsl * Added sonatype * Updated dependencies * Updated workflows * Added JitPack Signed-off-by: Francisco Solis <[email protected]>
1 parent d58ec06 commit 793904b

13 files changed

+250
-150
lines changed

.github/workflows/gradle-build.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@ jobs:
77
# Set up the OS
88
runs-on: ubuntu-latest
99
env:
10-
# Nexus credentials and GitHub token
11-
NEXUS_USERNAME: '${{ secrets.NEXUS_USERNAME }}'
12-
NEXUS_PASSWORD: '${{ secrets.NEXUS_PASSWORD }}'
10+
# Sonatype Credentials & GitHub token
11+
SONATYPE_USERNAME: '${{ secrets.SONATYPE_USERNAME }}'
12+
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}'
1313
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
1414
# Set environment
15-
env: 'prod'
15+
ENV: 'prod'
16+
PROJECT_NAME: 'LoggingModule'
1617
steps:
1718
# Checkout the Code
1819
- name: Checkout Code
1920
uses: actions/checkout@v3
2021
# Set up git hashes environment variables
2122
- name: Git Hashes
22-
uses: Im-Fran/[email protected].1
23+
uses: Im-Fran/[email protected].3
2324
# Set up version from tag environment variables
2425
- name: Version from Tag Action
25-
uses: Im-Fran/[email protected].1
26+
uses: Im-Fran/[email protected].3
2627
with:
2728
remove-first-character: 'v'
2829
# Set up the JDK
@@ -31,22 +32,30 @@ jobs:
3132
with:
3233
distribution: adopt
3334
java-version: 11
35+
cache: 'gradle'
3436
# Make gradle executable
3537
- name: Make gradle executable
3638
run: chmod +x gradlew
3739
# Clean, Test, Publish and Build (in that order to save the artifact to the action)
3840
- name: Test, Deploy and Build with Gradle
39-
run: ./gradlew clean test publish shadow dokkaHtml
41+
run: ./gradlew clean test shadowJar dokkaHtml publish publishToSonatype closeAndReleaseSonatypeStagingRepository -no-daemon
4042
# Now we store the artifact in the action
4143
- name: Upload the artifact
4244
uses: actions/upload-artifact@v3
4345
with:
44-
name: LoggingModule
45-
path: ./build/libs/LoggingModule-${{ env.VERSION }}.jar
46+
name: ${{ env.PROJECT_NAME }}
47+
path: ./build/libs/${{ env.PROJECT_NAME }}-${{ env.VERSION }}.jar
48+
# Here we upload the binary to the release
49+
- name: Upload to release
50+
uses: JasonEtco/upload-to-release@master
51+
with:
52+
args: ./build/libs/${{ env.PROJECT_NAME }}-${{ env.VERSION }}.jar application/java-archive
4653
# Now we deploy the documents to GitHub pages
4754
- name: Deploy Dokka
4855
uses: JamesIves/[email protected]
4956
with:
5057
branch: gh-pages
5158
folder: build/dokka
52-
clean: true
59+
clean: true
60+
clean-exclude: |
61+
CNAME

.github/workflows/gradle-test.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Test"
22
# Only execute this workflow when a PR is opened or when something is pushed to the master branch
3-
on: [push, pull_request]
3+
on: [pull_request]
44
jobs:
55
testBuilds:
66
strategy:
@@ -12,20 +12,21 @@ jobs:
1212
runs-on: ubuntu-latest
1313
# Set up environment variables
1414
env:
15-
env: 'local' # Set to local, so it won't deploy the jar to the repos
15+
ENV: 'local' # Set to local, so it won't deploy the jar to the repos
1616
steps:
17-
# Checkout code
18-
- name: Checkout Code
19-
uses: actions/checkout@v3
20-
# Setup java and maven
21-
- name: Set up JDK ${{ matrix.java-version }}
22-
uses: actions/setup-java@v3
23-
with:
24-
distribution: adopt
25-
java-version: ${{ matrix.java-version }}
26-
# Setup executable gradle
27-
- name: Make Gradle executable
28-
run: chmod +x gradlew
29-
# Test building without dokka
30-
- name: Build Jar with Java ${{ matrix.java-version }}
31-
run: ./gradlew clean publish shadow -x dokkaHtml
17+
# Checkout code
18+
- name: Checkout Code
19+
uses: actions/checkout@v3
20+
# Setup java and maven
21+
- name: Set up JDK ${{ matrix.java-version }}
22+
uses: actions/setup-java@v3
23+
with:
24+
distribution: adopt
25+
java-version: ${{ matrix.java-version }}
26+
cache: 'gradle'
27+
# Setup executable gradle
28+
- name: Make Gradle executable
29+
run: chmod +x gradlew
30+
# Test building without dokka
31+
- name: Build Jar with Java ${{ matrix.java-version }}
32+
run: ./gradlew clean shadowJar test -x dokkaHtml -no-daemon

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v0.3.0 - Snapshot
2+
* Updated to gradle kotlin dsl
3+
* Added sonatype
4+
* Updated dependencies
5+
* Updated workflows
6+
* Added JitPack
7+
18
## v0.2.2 - Snapshot
29
* Added `Logger#debug` method
310
* Added `Logger#severe(String, Exception)` method

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[![](https://jitci.com/gh/TheProgramSrc/SimpleCore-LoggingModule/svg)](https://jitci.com/gh/TheProgramSrc/SimpleCore-LoggingModule)
2+
[![](https://jitpack.io/v/TheProgramSrc/SimpleCore-LoggingModule.svg)](https://jitpack.io/#TheProgramSrc/SimpleCore-LoggingModule)
3+
4+
5+
# SimpleCore-LoggingModule
6+
Just a logger for the SimpleCore API
7+
8+
# Documentation
9+
* [Wiki](https://github.com/TheProgramSrc/SimpleCore-LoggingModule/wiki)
10+
* [JavaDocs](https://docs.theprogramsrc.xyz/SimpleCore-LoggingModule/)

build.gradle

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)