Skip to content

Commit

Permalink
Publish GitHub Packages by pushing to remote publish branch
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed May 4, 2021
1 parent 25a0c05 commit a0d8380
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish package to GitHub Packages
on:
push:
branches:
- 'publish'
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 a0d8380

Please sign in to comment.