diff --git a/.github/workflows/publish-gh.yml b/.github/workflows/publish-gh.yml new file mode 100644 index 0000000..f80963f --- /dev/null +++ b/.github/workflows/publish-gh.yml @@ -0,0 +1,22 @@ +name: Publish to GitHub packages + +on: [release] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + - name: Publish gradle + run: ./gradlew publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/options/build.gradle.kts b/options/build.gradle.kts index 7bc5520..2ad7e21 100644 --- a/options/build.gradle.kts +++ b/options/build.gradle.kts @@ -1,7 +1,28 @@ -@Suppress("DSL_SCOPE_VIOLATION") // Remove once KTIJ-19369 is fixed // to remove IDEA error on alias plugins { - java id("com.google.protobuf") version "0.9.1" + `maven-publish` +} + +publishing { + publications { + create("maven") { + groupId = "org.sudu" + artifactId = "javapoet" + version = project.version.toString() + + from(components["java"]) + } + } + repositories { + maven { + name = "ghPackages" + url = uri("https://maven.pkg.github.com/SuduIDE/protogen") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } } repositories {