Skip to content

Commit 45d4b9a

Browse files
committed
Update CI by using ci.yml
1 parent ec27166 commit 45d4b9a

File tree

4 files changed

+66
-15
lines changed

4 files changed

+66
-15
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
build-and-deploy:
9-
runs-on: ubuntun-latest
9+
runs-on: ubuntu-18.04
1010
steps:
1111

1212
- name: Checkout
@@ -17,19 +17,9 @@ jobs:
1717
with:
1818
java-version: 1.8
1919

20-
- name: Set Env
21-
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10}
22-
2320
- name: Build and deploy
2421
run: ./gradlew clean build bintrayUpload -PbintrayUser=${{secrets.JCENTER_NAME}} -PbintrayKey=${{secrets.JCENTER_TOKEN}} -PdryRun=false
2522

26-
- name: Update Release Example.apk
27-
uses: ShaunLWM/action-release-debugapk@master
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.TOKEN }}
30-
APP_FOLDER: app
31-
RELEASE_TITLE: ${{ env.RELEASE_VERSION }}
32-
3323
- name: Notification Slack
3424
uses: homoluctus/[email protected]
3525
if: always()
@@ -40,6 +30,6 @@ jobs:
4030
mention_if: 'failure'
4131
icon_emoji: ':rocket:'
4232
channel: '#android-apps-website'
43-
url: ${{secrets.SLACK_WEBHOOK_URL}}
33+
url: ${{ secrets.SLACK_WEBHOOK_URL }}
4434
commit: true
45-
token: ${{secrets.CI_LIB_TOKEN}}
35+
token: ${{ secrets.CI_LIB_TOKEN }}

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release And Update
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
7+
jobs:
8+
apk:
9+
name: Release APK
10+
runs-on: ubuntu-18.04
11+
steps:
12+
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Use Java8
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 1.8
20+
21+
- name: Generate Debug APK
22+
run: ./gradlew clean assembleDebug
23+
24+
- name: Upload APK
25+
uses: actions/upload-artifact@v1
26+
with:
27+
name: apk
28+
path: app/build/outputs/apk/debug/app-debug.apk
29+
30+
- name: Get the version
31+
id: get_version
32+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
33+
34+
- name: Create Release
35+
id: create_release
36+
uses: actions/create-release@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
tag_name: ${{ steps.get_version.outputs.VERSION }}
41+
release_name: Release ${{ steps.get_version.outputs.VERSION }}
42+
draft: false
43+
prerelease: false
44+
45+
- name: Upload Debug APK
46+
id: upload_release-asset
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ steps.create_release.outputs.upload_url }}
52+
asset_path: app/build/outputs/apk/debug/app-debug.apk
53+
asset_name: Example.apk
54+
asset_content_type: application/zip

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525

2626
## Introducation
2727
`PowerPermission` is a library to simplify process of demanding [RuntimePermission](https://developer.android.com/reference/java/lang/RuntimePermission).
28-
You find an `example application` in this Repo or downloading directly [here](https://github.com/underwindfall/PowerPermission/releases).
28+
> You find an `example application` in this Repo or downloading directly [here](https://github.com/underwindfall/PowerPermission/releases).
2929
Here are some different points compare with other libraries:
3030
- support asking permissions in `AppCompatActivity` and `Fragment(include ChildFragment)`
3131
- support custom rational view after user refuse permission
3232
- support ability to choose permissions to display rational views
3333
- support different interface (RxJava2,RxJava3,Coroutines,LiveData)
3434

35+
<div align="left" style="display:inline">
36+
<img width="200" height="450" src="https://raw.githubusercontent.com/underwindfall/blogAssets/master/lib/PowerPermission/example.gif">
37+
</div>
3538

3639
## How to Download
3740
### Basic

README_ZH.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@
2424
* [License](#license)
2525
## 简介
2626
`PowerPermission` 主要针对 `Android` 开发者在面对请求[RuntimePermission](https://developer.android.com/reference/java/lang/RuntimePermission)时的复杂流程的使用进行简化,来提高代码的便携效率。
27-
在这个Repo已经有个示例的`application`或者你可以通过这个[链接](https://github.com/underwindfall/PowerPermission/releases)直接下载APK.
27+
> 在这个Repo已经有个示例的`application`或者你可以通过这个[链接](https://github.com/underwindfall/PowerPermission/releases)直接下载APK.
2828
它和其他的第三方请求库不同的有以下几点:
2929
- 可在 `AppCompatActivity``Fragment(包括ChildFragment)` 中请求
3030
- 不固定了用户拒绝权限后的说明内容表现形式,可自行化定制
3131
- 可自主选择那些权限再次显示解释界面
3232
- 支持多种接口配置(RxJava2和RxJava3,Coroutines,LiveData)
3333

34+
<div align="left" style="display:inline">
35+
<img width="200" height="450" src="https://raw.githubusercontent.com/underwindfall/blogAssets/master/lib/PowerPermission/example.gif">
36+
</div>
37+
3438
## 配置方法
3539
### 基础库
3640
```groovy

0 commit comments

Comments
 (0)