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 9c173eb
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ include 'org.metafacture.fix.ide'
include 'org.metafacture.fix.web'

// change subproject name
project(":org.metafacture.fix").name = "metafacture-fix"
project(":org.metafacture.fix").name = "metafacture-fix"

0 comments on commit 9c173eb

Please sign in to comment.