Skip to content

Commit

Permalink
Set up publishing to GitHub Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Mar 17, 2021
1 parent 9ae4555 commit 26d22c9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish package to GitHub Packages
on:
push
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish package
run: gradle publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

30 changes: 30 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ subprojects {
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'org.xtext.builder'
apply plugin: 'maven-publish'

apply from: "${rootDir}/gradle/source-layout.gradle"

Expand Down Expand Up @@ -73,6 +74,35 @@ subprojects {

options.compilerArgs << '-Werror'
}

publishing {
publications {
mavenArtifacts(MavenPublication) {
from components.java
afterEvaluate {
groupId = project.group
artifactId = project.name
}
}
}
repositories {
maven {
name = 'LocalEmbedded'
// run generated gradle task `./gradlew
// publishMavenArtifactsPublicationToLocalEmbeddedRepository`
// to publish all subprojects into the same local embedded repo:
url = "file://${rootDir}/build/repo"
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/metafacture/metafacture-fix"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
}

task installServer(type: Copy) {
Expand Down

0 comments on commit 26d22c9

Please sign in to comment.