Skip to content

Commit

Permalink
-add publish workflow for publishing clearinghouse
Browse files Browse the repository at this point in the history
-add configuration for publishing to clearinghouse to build.gradle.kts
  • Loading branch information
Parisa68 committed Jul 16, 2024
1 parent 72a78c6 commit a339fd6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish package to GitHub Packages
on:
# release:
# types: [created]
push:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/[email protected]

- name: Publish package
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions lib/clearinghouse/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("java")
id ("java-library")
id("maven-publish")
id("io.freefair.lombok") version "8.6"
id("formatting-conventions")
Expand Down Expand Up @@ -31,3 +32,21 @@ dependencies {
testImplementation("org.bouncycastle:bcprov-jdk15to18:1.78.1")
testImplementation("org.bouncycastle:bcpkix-jdk15to18:1.78.1")
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
repositories {
maven {
name = "fega-norway-clearinghouse"
url = uri("https://maven.pkg.github.com/ELIXIR-NO/FEGA-Norway")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit a339fd6

Please sign in to comment.