Skip to content

Commit

Permalink
Develop (#4)
Browse files Browse the repository at this point in the history
* add some documentation

* fix cicd

* add template for issue

* add template for issue

* add PR template

* fix junit and add more documentation
  • Loading branch information
jimlyas authored Jan 25, 2022
1 parent e772ddf commit b8a49eb
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 20 deletions.
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pr_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Pull Request
description: Requesting for a Pull
body:
- type: checkboxes
attributes:
label: Contribution guidelines
description: Please read the contribution guidelines before proceeding.
options:
- label: I've read the [contribution guidelines](https://github.com/jimlyas/okdynamic/blob/master/CONTRIBUTING.md) and wholeheartedly agree
required: true
- type: textarea
attributes:
label: Description
description: Please provide a brief description about your Pull Request
validations:
required: true
- type: textarea
attributes:
label: Steps to produce
description: Please describe how to test your Pull Request
validations:
required: true
14 changes: 1 addition & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
name: publish
name: Publish new documentation
on:
push:
branches:
- main
jobs:
deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
cache: gradle
- name: Execute Gradle build
run: ./gradlew publish -Pusername_github=${{ secrets.username_github }} -Pkey_github=${{ secrets.key_github }}
documentation:
runs-on: ubuntu-latest
steps:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Release The library
on:
workflow_dispatch:
inputs:
versionName:
description: "Version Name"
required: true
jobs:
tag:
name: Create a new tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Grant Permission to Execute Gradle
run: chmod +x gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
- name: Publish the library
run: |
./gradlew publish
env:
username_github: ${{ secrets.username_github }}
key_github: ${{ secrets.key_github }}
- name: Create a tag and push it
run: |
git config --global user.email "[email protected]"
git config --global user.name "jimlyas"
git tag -a $TAG -m "Release v$TAG"
git push origin $TAG
env:
TAG: ${{ github.event.inputs.versionName }}
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: "11"
distribution: "adopt"
- name: Create release
uses: ncipollo/release-action@v1
with:
name: ${{ github.event.inputs.versionName }}
artifacts: "okdynamic/build/outputs/aar/okdynamic-debug.aar"
bodyFile: "README.md"
token: ${{ secrets.KEY_GITHUB }}
4 changes: 2 additions & 2 deletions docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ allProjects {

## Adding Dependencies

![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/jimlyas/okdynamic?sort=semver)
In your app's `build.gradle`, add this dependencies:

```groovy title="build.gradle"
Expand All @@ -36,5 +37,4 @@ dependencies {
}
```

By changing the VERSION to the latest version of the library
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/jimlyas/okdynamic?sort=semver)
By changing the VERSION to the latest version of the library.
8 changes: 8 additions & 0 deletions docs/implementation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

## Adding the Interceptor

In your `okhttp` builder, add the interceptor:

```kotlin

```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ copyright: © 2021 Jimly A.
nav:
- Home: index.md
- Download: download.md
- Implementation: implementation.md
- Security: security.md

markdown_extensions:
Expand Down
6 changes: 3 additions & 3 deletions okdynamic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ afterEvaluate {
maven {
setUrl("https://maven.pkg.github.com/jimlyas/okdynamic")
credentials {
username = properties["username_github"].toString()
password = properties["key_github"].toString()
username = System.getenv("username_github")
password = System.getenv("key_github")
}
}
}
Expand Down Expand Up @@ -67,7 +67,7 @@ android {
dependencies {
implementation("androidx.core:core-ktx:1.7.0")
implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.3")
testImplementation("junit:junit:5.0.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import okhttp3.Interceptor
class OkDynamic : Interceptor {
private lateinit var environments: Array<out Pair<Environment, String>>

private var environment: Environment = Environment.DEBUG
private var environment: Environment = Environment.DEVELOPMENT

override fun intercept(chain: Interceptor.Chain) = chain.proceed(chain.request())

Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies {
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.appcompat:appcompat:1.4.1")
implementation("com.google.android.material:material:1.5.0")
testImplementation("junit:junit:5.0.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
}

0 comments on commit b8a49eb

Please sign in to comment.