Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
name: Build
on: [pull_request, push]

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Build the app
- name: Checkout
uses: actions/checkout@v4

- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
cache: gradle

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4

- name: Build
run: ./gradlew build
36 changes: 36 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Release

on:
push:
tags:
- '*'

env:
RELEASE_SIGNING_ENABLED: true

jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'Commit451/okyo'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
cache: gradle

- name: Set version
run: sed -i "s/VERSION_NAME=1.0.0/VERSION_NAME=$GITHUB_REF_NAME/" gradle.properties

- name: Release to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

[okio](https://github.com/square/okio) made easy, yo

[![](https://jitpack.io/v/Commit451/okyo.svg)](https://jitpack.io/#Commit451/okyo)
[![Maven Central](https://img.shields.io/maven-central/v/com.commit451/okyo.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.commit451/okyo)

## Gradle

```kotlin
dependencies {
implementation("com.commit451:okyo:VERSION")
}
```

# Usefulness

Expand Down
41 changes: 25 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
buildscript {
ext.kotlin_version = '1.8.22'
import com.vanniktech.maven.publish.SonatypeHost

repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm' version '2.1.10'
id 'com.vanniktech.maven.publish' version '0.30.0'
}

group 'com.commit451.okyo'
version '1.0.0'

apply plugin: 'java-library'
apply plugin: 'kotlin'
group = findProperty("GROUP")
version = findProperty("VERSION_NAME")

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion = JavaLanguageVersion.of(17)
}
}

kotlin {
jvmToolchain(17)
}

repositories {
mavenCentral()
}

dependencies {
api("com.squareup.okio:okio:3.5.0")
api("com.squareup.okio:okio:3.10.2")

testImplementation 'junit:junit:4.13.1'
testImplementation("junit:junit:4.13.2")
}

tasks.withType(Test).configureEach {
useJUnit()
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
if (System.getenv("RELEASE_SIGNING_ENABLED") == "true") {
signAllPublications()
}
}
25 changes: 25 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
GROUP=com.commit451
POM_ARTIFACT_ID=okyo
POM_PACKAGING=jar

POM_NAME=okyo
POM_DESCRIPTION=okio made easy, yo
POM_INCEPTION_YEAR=2017
POM_URL=https://github.com/Commit451/okyo/

POM_LICENSE_NAME=The Apache Software License, Version 2.0
POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENSE_DIST=repo

POM_SCM_URL=https://github.com/Commit451/okyo/
POM_SCM_CONNECTION=scm:git:git://github.com/Commit451/okyo/.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/Commit451/okyo/.git

POM_DEVELOPER_ID=Commit451
POM_DEVELOPER_NAME=Commit 451
POM_DEVELOPER_URL=https://github.com/Commit451/

SONATYPE_CONNECT_TIMEOUT_SECONDS=60
SONATYPE_CLOSE_TIMEOUT_SECONDS=900

VERSION_NAME=1.0.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down