File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish package to GitHub Packages
2
+ on :
3
+ push
4
+ jobs :
5
+ publish :
6
+ runs-on : ubuntu-latest
7
+ steps :
8
+ - uses : actions/checkout@v2
9
+ - uses : actions/setup-java@v1
10
+ with :
11
+ java-version : 1.8
12
+ - name : Publish package
13
+ run : gradle publish
14
+ env :
15
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
16
+
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ subprojects {
42
42
apply plugin : ' signing'
43
43
apply plugin : ' maven'
44
44
apply plugin : ' jacoco'
45
+ apply plugin : ' maven-publish'
45
46
46
47
sourceCompatibility = 1.8
47
48
targetCompatibility = 1.8
@@ -197,9 +198,43 @@ gradle.projectsEvaluated {
197
198
}
198
199
}
199
200
201
+ // 'upload' vs. 'publish, see
202
+ // https://medium.com/dot-debug/deploying-artifacts-to-maven-using-gradle-b669acc1b6f8'
203
+ /*
200
204
task publish {
201
205
dependsOn tasks.uploadArchives
202
206
}
207
+ */
208
+
209
+ publishing {
210
+ publications {
211
+ mavenArtifacts(MavenPublication ) {
212
+ from components. java
213
+ afterEvaluate {
214
+ groupId = project. group
215
+ artifactId = project. name
216
+ }
217
+ }
218
+ }
219
+
220
+ repositories {
221
+ maven {
222
+ name = ' localEmbedded'
223
+ // run generated gradle task `./gradlew
224
+ // publishMavenArtifactsPublicationToLocalEmbeddedRepository`
225
+ // to publish all subprojects into the same local embedded repo:
226
+ url = " file://${ rootDir} /build/repo"
227
+ }
228
+ maven {
229
+ name = " GitHubPackages"
230
+ url = " https://maven.pkg.github.com/metafacture/metafacture-core"
231
+ credentials {
232
+ username = System . getenv(" GITHUB_ACTOR" )
233
+ password = System . getenv(" GITHUB_TOKEN" )
234
+ }
235
+ }
236
+ }
237
+ }
203
238
}
204
239
}
205
240
You can’t perform that action at this time.
0 commit comments