Skip to content

Commit

Permalink
Setup publishing to Github Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
altrisi committed Jan 28, 2023
1 parent b769acf commit b7ba430
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish package to GitHub Packages
on:
release:
types: [published]
jobs:
Publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
cache: 'gradle'
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Publish package
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 24 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
plugins {
id 'java'
id 'java-library'
id 'java'
id 'java-library'
id 'eclipse'
id 'maven-publish'
}

archivesBaseName = 'sisaassembler'
Expand All @@ -18,5 +20,24 @@ java {
}

test {
useJUnitPlatform()
useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = 'sisaassembler'
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/illogicworks/sisaj"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit b7ba430

Please sign in to comment.