Skip to content

Commit

Permalink
Prepare GitHub packages
Browse files Browse the repository at this point in the history
  • Loading branch information
cvb941 committed Apr 27, 2024
1 parent 0e274cd commit 1286be7
Showing 4 changed files with 50 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish package to the Maven Central Repository
on:
release:
types: [ created ]
workflow_dispatch:

jobs:
publish:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'

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

- name: Publish package
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ plugins {
kotlin("multiplatform") version "1.9.23"
id("org.jetbrains.kotlinx.benchmark") version "0.4.10"
id("org.jetbrains.kotlin.plugin.allopen") version "1.9.23"
id("maven-publish")
}

group = "net.kusik"
@@ -15,7 +16,7 @@ repositories {

kotlin {
jvm {
jvmToolchain(19)
jvmToolchain(11)
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
@@ -88,3 +89,16 @@ benchmark {
allOpen {
annotation("org.openjdk.jmh.annotations.State")
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/cvb941/kotlin-parallel-operations")
credentials {
username = project.findProperty("gpr.user")?.toString() ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key")?.toString() ?: System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit 1286be7

Please sign in to comment.