diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml new file mode 100644 index 0000000..8945435 --- /dev/null +++ b/.github/workflows/release-github.yml @@ -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 }} diff --git a/build.gradle.kts b/build.gradle.kts index 0191165..6cf7416 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,19 @@ allprojects { version = "0.2.1" group = "io.github.rockcrafters" + apply(plugin = "maven-publish") + plugins.withType().configureEach { + extensions.configure() { + 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") + } + } + } + } + } }