From 12f8b157b863b6a506d52ce349f6146bd8fff0b2 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Sun, 17 Apr 2022 08:24:26 +0200 Subject: [PATCH] CI with Github action --- .github/dependabot.yml | 15 +++++ .github/release.yml | 16 ++++++ .github/workflows/Android-CI-release.yml | 56 +++++++++++++++++++ .github/workflows/Android-CI.yml | 35 ++++++++++++ .../workflows/gradle-wrapper-validation.yml | 17 ++++++ .github/workflows/update-gradle-wrapper.yml | 18 ++++++ 6 files changed, 157 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/release.yml create mode 100644 .github/workflows/Android-CI-release.yml create mode 100644 .github/workflows/Android-CI.yml create mode 100644 .github/workflows/gradle-wrapper-validation.yml create mode 100644 .github/workflows/update-gradle-wrapper.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0377071 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gradle" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..d62e3ab --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,16 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - someuser + categories: + - title: Breaking Changes 🛠 + labels: + - breaking-change + - title: Exciting New Features 🎉 + labels: + - enhancement + - title: Other Changes + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/Android-CI-release.yml b/.github/workflows/Android-CI-release.yml new file mode 100644 index 0000000..c19673a --- /dev/null +++ b/.github/workflows/Android-CI-release.yml @@ -0,0 +1,56 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + name: Publish release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Get the version + id: tagger + uses: jimschubert/query-tag-action@v2 + with: + skip-unshallow: 'true' + abbrev: false + commit-ish: HEAD + - name: Check pre-release + run: | + echo "tag=${{steps.tagger.outputs.tag}}" + if [[ ${{ steps.tagger.outputs.tag }} == *alpha* || ${{ steps.tagger.outputs.tag }} == *beta* ]] + then + prerelease=true + else + prerelease=false + fi + echo "PRE_RELEASE=$prerelease" >> $GITHUB_ENV + echo "prerelease=$prerelease" + - name: Install JDK ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: 11 + - name: Install Android SDK + uses: malinskiy/action-android/install-sdk@release/0.1.4 + - name: Build project + run: ./gradlew assembleRelease + env: + VERSION: ${{steps.tagger.outputs.tag}} + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{steps.tagger.outputs.tag}} + prerelease: ${{ env.PRE_RELEASE }} + name: ${{steps.tagger.outputs.tag}} + generate_release_notes: true + files: | + ./libStream/build/outputs/aar/libStream*.aar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/Android-CI.yml b/.github/workflows/Android-CI.yml new file mode 100644 index 0000000..12db630 --- /dev/null +++ b/.github/workflows/Android-CI.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + BuildTest: + name: Build and test JDK ${{ matrix.java_version }} + runs-on: macOS-latest + strategy: + matrix: + java_version: [11] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK ${{ matrix.java_version }} + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: ${{ matrix.java_version }} + - name: Install Android SDK + uses: malinskiy/action-android/install-sdk@release/0.1.2 + - name: Build project + run: ./gradlew assembleDebug +# - name: gradle check +# run: ./gradlew check +# - name: Archive Lint report +# uses: actions/upload-artifact@v3 +# if: ${{ always() }} +# with: +# name: Logcat-Lint-report +# path: sample/build/reports/lint-results*.html diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 0000000..6dfd6da --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,17 @@ +name: "Validate Gradle Wrapper" + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/update-gradle-wrapper.yml b/.github/workflows/update-gradle-wrapper.yml new file mode 100644 index 0000000..7192f32 --- /dev/null +++ b/.github/workflows/update-gradle-wrapper.yml @@ -0,0 +1,18 @@ +name: Update Gradle Wrapper + +on: + schedule: + - cron: "0 6 * * MON" + +jobs: + update-gradle-wrapper: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Update Gradle Wrapper + uses: gradle-update/update-gradle-wrapper-action@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + set-distribution-checksum: false