Skip to content

Commit

Permalink
Workaround for atomic-fu
Browse files Browse the repository at this point in the history
  • Loading branch information
Vodes committed Dec 15, 2024
1 parent a969fbf commit 03a602d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/auto-publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Publish snapshot to styx repo"
on:
push:

jobs:
build:
runs-on: macos-latest
env:
STYX_REPO_TOKEN: ${{ secrets.STYX_REPO_TOKEN }}
STYX_REPO_SECRET: ${{ secrets.STYX_REPO_SECRET }}

steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Setup JDK"
id: setup-java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
- name: Set commit env variable
run: echo "SNAPSHOT_COMMIT=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: "Build and publish library"
env:
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
run: |
chmod u+x ./gradlew
./gradlew publishAllPublicationsToStyxRepository -Pversion=$SNAPSHOT_COMMIT -Dorg.gradle.parallel=false --stacktrace --no-configuration-cache
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import extensions.isMultiplatformModule
import extensions.kotlinMultiplatform

Expand Down Expand Up @@ -36,10 +35,11 @@ configure<PublishingExtension> {
repositories {
maven {
name = "Styx"
url = if (version.toString().contains("-SNAPSHOT", true))
uri("https://repo.styx.moe/snapshots")
else
uri("https://repo.styx.moe/releases")
url =
if (version.toString().contains("-SNAPSHOT", true) || !System.getenv("SNAPSHOT_COMMIT").isNullOrBlank())
uri("https://repo.styx.moe/snapshots")
else
uri("https://repo.styx.moe/releases")
credentials {
username = System.getenv("STYX_REPO_TOKEN")
password = System.getenv("STYX_REPO_SECRET")
Expand Down
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ apiValidation {
}
}

allprojects {
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlinx" && requested.name == "atomicfu") {
useVersion("0.23.2")
}
}
}
}

fun MutableSet<String>.add(dependency: DelegatingProjectDependency) = add(dependency.name)
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]
agp = "8.7.2"
kotlin = "2.1.0"
kotlin = "2.0.21"
mavenPublish = "0.30.0"
composeMultiplatform = "1.7.1"
binaryCompatibilityValidator = "0.16.3"
atomicfu = "0.26.1"
atomicfu = "0.23.2"

ktlint = "12.1.2"
coroutines = "1.9.0"
Expand Down

0 comments on commit 03a602d

Please sign in to comment.