diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml new file mode 100644 index 0000000..35d63db --- /dev/null +++ b/.github/workflows/pre-release.yaml @@ -0,0 +1,24 @@ +name: Pre-release + +on: + release: + types: + - prereleased + +jobs: + deploy-snapshot: + name: Deploy snapshot + runs-on: + - ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Upload Github + env: + RELEASE_NAME: ${{ github.event.release.name }}-SNAPSHOT + DEPLOY-KEY: ${{ secrets.DEPLOY-KEY }} + run: ./gradlew kmvi:publishAllPublicationsToGitHubPackagesRepository diff --git a/kmvi/build.gradle.kts b/kmvi/build.gradle.kts index b8fc526..3ab28ab 100644 --- a/kmvi/build.gradle.kts +++ b/kmvi/build.gradle.kts @@ -1,10 +1,16 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework +import java.net.URI plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidLibrary) + id("maven-publish") } +group = "io.github.natobytes.kmvi" +version = System.getenv()["RELEASE_NAME"] ?: "0.1.0" + + kotlin { jvm() @@ -50,3 +56,16 @@ android { targetCompatibility = JavaVersion.VERSION_1_8 } } + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = URI("https://maven.pkg.github.com/natobytes/KMVI/") + credentials { + username = "natobytes" + password = System.getenv()["DEPLOY-KEY"] ?: "" + } + } + } +}