From ba92c6f891cf45ea76e9c68bc6cf8f23ecc3e3b0 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Wed, 6 Oct 2021 20:45:03 +0200 Subject: [PATCH 1/8] Create gradle-publish.yml --- .github/workflows/gradle-publish.yml | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/gradle-publish.yml diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml new file mode 100644 index 0000000..a74a1ce --- /dev/null +++ b/.github/workflows/gradle-publish.yml @@ -0,0 +1,37 @@ +# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle + +name: Gradle Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Gradle + run: gradle build + + # The USERNAME and TOKEN need to correspond to the credentials environment variables used in + # the publishing section of your build.gradle + - name: Publish to GitHub Packages + run: gradle publish + env: + USERNAME: ${{ github.actor }} + TOKEN: ${{ secrets.GITHUB_TOKEN }} From b98411d8e5de4ad5155c7f4cb5e15f7059cba1ae Mon Sep 17 00:00:00 2001 From: afischerdev Date: Wed, 6 Oct 2021 21:05:30 +0200 Subject: [PATCH 2/8] Delete gradle-publish.yml --- .github/workflows/gradle-publish.yml | 37 ---------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/gradle-publish.yml diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml deleted file mode 100644 index a74a1ce..0000000 --- a/.github/workflows/gradle-publish.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle - -name: Gradle Package - -on: - release: - types: [created] - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Build with Gradle - run: gradle build - - # The USERNAME and TOKEN need to correspond to the credentials environment variables used in - # the publishing section of your build.gradle - - name: Publish to GitHub Packages - run: gradle publish - env: - USERNAME: ${{ github.actor }} - TOKEN: ${{ secrets.GITHUB_TOKEN }} From 21a246b98d565e97d53e4548721cf76c8182be0b Mon Sep 17 00:00:00 2001 From: afischerdev Date: Wed, 6 Oct 2021 21:07:59 +0200 Subject: [PATCH 3/8] Create gradle-publish.yml --- .github/workflows/gradle-publish.yml | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/gradle-publish.yml diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml new file mode 100644 index 0000000..a74a1ce --- /dev/null +++ b/.github/workflows/gradle-publish.yml @@ -0,0 +1,37 @@ +# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle + +name: Gradle Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Gradle + run: gradle build + + # The USERNAME and TOKEN need to correspond to the credentials environment variables used in + # the publishing section of your build.gradle + - name: Publish to GitHub Packages + run: gradle publish + env: + USERNAME: ${{ github.actor }} + TOKEN: ${{ secrets.GITHUB_TOKEN }} From 55ad4b15ab013bdd6783455db1ddf4131c59a7d1 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Wed, 6 Oct 2021 21:22:32 +0200 Subject: [PATCH 4/8] Update gradle-publish.yml --- .github/workflows/gradle-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index a74a1ce..22922e1 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -4,6 +4,7 @@ name: Gradle Package on: + workflow_dispatch: release: types: [created] From 9c4c998f0e2f199d7ac5639151991042cfa2c64a Mon Sep 17 00:00:00 2001 From: afischerdev Date: Wed, 6 Oct 2021 21:32:46 +0200 Subject: [PATCH 5/8] Update gradle-publish.yml --- .github/workflows/gradle-publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index 22922e1..45a9836 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -5,6 +5,9 @@ name: Gradle Package on: workflow_dispatch: + branches: + - main + - af-patch-gradle release: types: [created] From 300a6fa49aae19afd8bf1a4f130d81cc40d45887 Mon Sep 17 00:00:00 2001 From: Manuel Fuhr Date: Wed, 6 Oct 2021 11:38:47 +0200 Subject: [PATCH 6/8] Add gradle publish --- .github/workflows/gradle-publish.yml | 36 ++++++++++++++++++++++++++++ build.gradle | 16 +++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/gradle-publish.yml diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml new file mode 100644 index 0000000..2a9913e --- /dev/null +++ b/.github/workflows/gradle-publish.yml @@ -0,0 +1,36 @@ +# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle + +name: Gradle Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'zulu' + + - name: Build with Gradle + run: ./gradlew build + + # The USERNAME and TOKEN need to correspond to the credentials environment variables used in + # the publishing section of your build.gradle + - name: Publish to GitHub Packages + run: gradle publish + env: + USERNAME: ${{ github.actor }} + TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} diff --git a/build.gradle b/build.gradle index 8c9d653..c11e773 100644 --- a/build.gradle +++ b/build.gradle @@ -29,6 +29,22 @@ allprojects { google() } + apply plugin: "maven-publish" + publishing { + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/$System.env.REPO") + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") + password = project.findProperty("gpr.key") ?: System.getenv("TOKEN") + } + } + } + publications { + gpr(MavenPublication) + } + } } task clean(type: Delete) { From bde43fc915ffbbdd633ea60a4b41073a898d303f Mon Sep 17 00:00:00 2001 From: Manuel Fuhr Date: Wed, 6 Oct 2021 19:53:14 +0200 Subject: [PATCH 7/8] Add group to toplevel build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c11e773..7e9984f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { @@ -23,6 +22,7 @@ allprojects { // app: build.gradle (versionCode only) // OsmTrack (version and versionDate) project.version "1.6.2" + group 'org.btools' repositories { mavenCentral() From 1943ac65477a0918c1e713efd252243d56af0d87 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Thu, 7 Oct 2021 11:02:36 +0200 Subject: [PATCH 8/8] Update gradle-publish.yml --- .github/workflows/gradle-publish.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index 45a9836..b808678 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -4,12 +4,7 @@ name: Gradle Package on: - workflow_dispatch: - branches: - - main - - af-patch-gradle - release: - types: [created] + workflow_dispatch jobs: build: