Skip to content

Commit 4dc9f56

Browse files
author
Mark Whitaker
authored
Add GitHub Packages publish workflow (#9)
1 parent 4bfcaad commit 4dc9f56

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Publish to GitHub Packages
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish-to-nuget:
8+
name: Publish release to GitHub Packages
9+
uses: markwhitaker/shared-workflows/.github/workflows/gradle-publish-to-github-packages.yml@main
10+
secrets: inherit

build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ buildscript {
55
plugins {
66
id 'java-library'
77
id 'com.palantir.git-version' version '0.15.0'
8+
id 'maven-publish'
89
}
910

1011
repositories {
@@ -19,3 +20,21 @@ sourceCompatibility = JavaVersion.VERSION_1_8
1920
dependencies {
2021
testImplementation "junit:junit:$junit_version"
2122
}
23+
24+
publishing {
25+
repositories {
26+
maven {
27+
name = "GitHubPackages"
28+
url = uri("https://maven.pkg.github.com/markwhitaker/mimetypes.java")
29+
credentials {
30+
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
31+
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
32+
}
33+
}
34+
}
35+
publications {
36+
gpr(MavenPublication) {
37+
from(components.java)
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)