From 7bc232158c299e23fabea4331a1e31a63955649d Mon Sep 17 00:00:00 2001 From: Teodor Grigor Date: Tue, 26 Sep 2023 11:43:26 +0300 Subject: [PATCH] Add GitHub Workflows and Pull Request Templates --- .../pull_request_template.md | 16 +++++++++ .github/ci-gradle.properties | 28 +++++++++++++++ .github/workflows/publish.yml | 36 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md create mode 100644 .github/ci-gradle.properties create mode 100644 .github/workflows/publish.yml diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 0000000..770cd6b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,16 @@ +--- +name: Pull request +about: Create a pull request +label: 'triage me' +--- +Thank you for opening a Pull Request! +Before submitting your PR, there are a few things you can do to make sure it goes smoothly: + +- [ ] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way + we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter + pass (`./gradlew --init-script gradle/init.gradle.kts spotlessApply` to automatically apply + formatting) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # 🦕 diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties new file mode 100644 index 0000000..bd98970 --- /dev/null +++ b/.github/ci-gradle.properties @@ -0,0 +1,28 @@ +# +# Copyright 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +org.gradle.daemon=false +org.gradle.parallel=true +org.gradle.workers.max=2 + +kotlin.incremental=false +kotlin.compiler.execution.strategy=in-process + +# Controls KotlinOptions.allWarningsAsErrors. +# This value used in CI and is currently set to false. +# If you want to treat warnings as errors locally, set this property to true +# in your ~/.gradle/gradle.properties file. +warningsAsErrors=false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a61192e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: Publish to Maven + +on: + workflow_dispatch: + +jobs: + publish: + name: Snapshot build and publish + runs-on: ubuntu-latest + environment: PRODUCTION + timeout-minutes: 120 + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + SONATYPE_CONNECT_TIMEOUT_SECONDS: 120 + SONATYPE_CLOSE_TIMEOUT_SECONDS: 1800 + + steps: + - name: Check out code + uses: actions/checkout@v3.1.0 + + - name: Set up JDK 17 + uses: actions/setup-java@v3.5.1 + with: + distribution: 'zulu' + java-version: 17 + + - name: Grant Permission to Execute Gradle + run: chmod +x gradlew + + - name: Publish to MavenCentral + run: | + ./gradlew publish --no-configuration-cache