From 272471881ab7c013e1a72ab0f758c1f2c947505c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Sat, 11 Nov 2023 00:18:01 +0100 Subject: [PATCH 1/3] Setup snapshot builds --- .github/workflows/publish_snapshots.yml | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/publish_snapshots.yml b/.github/workflows/publish_snapshots.yml index bfc31c9..9434984 100644 --- a/.github/workflows/publish_snapshots.yml +++ b/.github/workflows/publish_snapshots.yml @@ -11,6 +11,46 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: + build: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Write Gradle build properties to `~/.gradle/gradle.properties` + run: | + mkdir -p ~/.gradle + printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties + printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties + shell: bash + + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 21 + + - name: Build app with Gradle + uses: gradle/gradle-build-action@v2 + + - run: ./gradlew assemble + + - name: Unwrap GPG key + env: + GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }} + SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} + run: sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'" + + - name: Publish to Github Package Registry + run: ./gradlew publishAllPublicationsToGithubRepository + diffuse: runs-on: ubuntu-latest steps: From cd527b707ed1713f2ecd8f3ac20d6fce2e637273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Sat, 11 Nov 2023 00:18:55 +0100 Subject: [PATCH 2/3] Setup release publishing --- .github/workflows/publish_release.yml | 50 +++++++++++++++++++++++++++ README.md | 1 - 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish_release.yml diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml new file mode 100644 index 0000000..d7866d3 --- /dev/null +++ b/.github/workflows/publish_release.yml @@ -0,0 +1,50 @@ +name: Publish Project to all Maven repositories + +on: + push: + tags: + - 'v*' + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + build: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Write Gradle build properties to `~/.gradle/gradle.properties` + run: | + mkdir -p ~/.gradle + printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties + printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties + shell: bash + + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 21 + + - uses: gradle/gradle-build-action@v2 + + - name: Unwrap GPG key + env: + GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }} + SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} + run: sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'" + + - run: ./gradlew publishAllPublicationsToGithubRepository + + - run: ./gradlew publishAllPublicationsToMavenCentralRepository + + - run: ./gradlew publishPlugins -Pgradle.publish.key=${{ secrets.gradle_publish_key }} -Pgradle.publish.secret=${{ secrets.gradle_publish_secret }} diff --git a/README.md b/README.md index 2917611..27419e6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # lincesee-for-android -___ Turn raw [cashapp/licensee](https://github.com/cashapp/licensee) report into assets/Kotlin code that can be easily consumed from an Android app From ca003e69721de1cf6debe24c5fb2fe1f68fb8345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Sat, 11 Nov 2023 00:29:35 +0100 Subject: [PATCH 3/3] Update Readme --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 27419e6..2750e94 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# lincesee-for-android +# licensee-for-android + +[![Build Status](https://github.com/usefulness/licensee-for-android/workflows/Build%20Project/badge.svg)](https://github.com/usefulness/licensee-for-android/actions) +[![Latest Version](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/io/github/usefulness/licensee-for-android/maven-metadata.xml?label=gradle)](https://plugins.gradle.org/plugin/io.github.usefulness.licensee-for-android) +![Maven Central](https://img.shields.io/maven-central/v/io.github.usefulness/licensee-for-android) + Turn raw [cashapp/licensee](https://github.com/cashapp/licensee) report into assets/Kotlin code that can be easily consumed from an Android app