From 1534b707ec067dea0fd95a7eb429e6f5cdeb744b Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Fri, 12 Mar 2021 11:30:32 +0100 Subject: [PATCH] Set up publishing to GitHub Packages See: https://github.com/metafacture/metafacture-core/issues/356 https://gitlab.com/oersi/oersi-etl/-/issues/59 --- .github/workflows/publish.yml | 17 +++++++++++++++++ build.gradle | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..b073c4ff8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,17 @@ +name: Publish package to GitHub Packages +on: + release: + types: [created] +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 }} + diff --git a/build.gradle b/build.gradle index 3a2e4d071..31079549c 100644 --- a/build.gradle +++ b/build.gradle @@ -338,3 +338,16 @@ def static extractVersionFromBranch(branch) { } return matcher.group(1) } + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/metafacture/metafacture-core" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +}