Skip to content

Commit

Permalink
feat(ci): add ability to publish to github maven repository
Browse files Browse the repository at this point in the history
Signed-off-by: Sphericalkat <amolele@gmail.com>
  • Loading branch information
SphericalKat committed May 1, 2023
1 parent e604d7b commit 84f67b3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish snapshots

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up JDK
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
distribution: 'temurin'
java-version: '17'

- name: Publish snapshots
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
with:
arguments: publishAllPublicationsToGithubPackagesRepository

16 changes: 16 additions & 0 deletions atomic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import java.net.URI

plugins {
id("java")
id("java-library")
id ("maven-publish")
}

group = "jp.co.goalist"

publishing {
repositories {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/SphericalKat/atomic-demo")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

repositories {
mavenCentral()
}
Expand Down

0 comments on commit 84f67b3

Please sign in to comment.