Skip to content
Closed
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
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- publish-fork
pull_request:
types: [opened, labeled, unlabeled, synchronize]

Expand All @@ -14,6 +15,42 @@ env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
publish-ghcr:
runs-on: ubuntu-latest
if: github.repository == 'gesellix/okhttp'
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

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

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

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Upload Artifacts
run: ./gradlew clean publishAllPublicationsToGithubPackagesRepository --stacktrace
env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ env.GITHUB_ACTOR }}
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
# ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
# ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}

publish:
runs-on: ubuntu-latest
if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master'
Expand Down
30 changes: 26 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import ru.vyarus.gradle.plugin.animalsniffer.AnimalSnifferExtension
import java.net.URI
import java.text.SimpleDateFormat
import java.util.Date

buildscript {
dependencies {
Expand Down Expand Up @@ -50,8 +52,9 @@ configure<SpotlessExtension> {
}

allprojects {
group = "com.squareup.okhttp3"
version = "5.3.0-SNAPSHOT"
group = "de.gesellix.okhttp3-forked"
version = "5.3.0-${SimpleDateFormat("yyyy-MM-dd\'T\'HH-mm-ss").format(Date())}"
// version = "5.3.0-SNAPSHOT"

repositories {
mavenCentral()
Expand Down Expand Up @@ -324,8 +327,10 @@ subprojects {

plugins.withId("com.vanniktech.maven.publish.base") {
configure<MavenPublishBaseExtension> {
publishToMavenCentral(automaticRelease = true)
signAllPublications()
if (!gradle.startParameter.taskNames.contains("publishAllPublicationsToGithubPackagesRepository")) {
publishToMavenCentral(automaticRelease = true)
signAllPublications()
}
pom {
name.set(project.name)
description.set("Square’s meticulous HTTP client for Java and Kotlin.")
Expand All @@ -349,6 +354,23 @@ subprojects {
}
}
}
configure<PublishingExtension> {
repositories {
maven {
name = "githubPackages"
url = uri("https://maven.pkg.github.com/gesellix/okhttp")
// username and password (a personal Github access token) should be specified as
// `githubPackagesUsername` and `githubPackagesPassword` Gradle properties or alternatively
// as `ORG_GRADLE_PROJECT_githubPackagesUsername` and `ORG_GRADLE_PROJECT_githubPackagesPassword`
// environment variables
credentials(PasswordCredentials::class)
// credentials {
// username = System.getenv("GITHUB_ACTOR")
// password = System.getenv("GITHUB_TOKEN")
// }
}
}
}
}

plugins.withId("binary-compatibility-validator") {
Expand Down
Loading