Skip to content

Commit

Permalink
chore: add github packages publication
Browse files Browse the repository at this point in the history
  • Loading branch information
vpa1977 committed Oct 18, 2024
1 parent 9278e00 commit 5697acc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to github
on:
workflow_dispatch:

jobs:
build:
name: release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
uses: actions/checkout@v4
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'

- name: Publish to Github Packages
id: deploy
run: |
./gradlew publish -i -Pgpr.repo=$${{ vars.GHP_REPO }}
mvn deploy -Pgithub -DaltDeploymentRepository=releaseRepository::default::$${{ vars.GHP_REPO }}
shell: bash
env:
GHP_USERNAME: ${{ secrets.GHP_USERNAME }}
GHP_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
allprojects {
version = "0.2.1"
group = "io.github.rockcrafters"
apply(plugin = "maven-publish")
plugins.withType<MavenPublishPlugin>().configureEach {
extensions.configure<PublishingExtension>() {
repositories {
maven {
name = "GitHubPackages"
url = uri(project.findProperty("gpr.repo") ?: "")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GHP_USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GHP_TOKEN")
}
}
}
}
}
}

0 comments on commit 5697acc

Please sign in to comment.