forked from bahacan19/dotsindicator
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.55 KB
/
gradle-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Release
on:
release:
types: [created]
jobs:
publish:
name: Release OzanSuperApp's Library
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v1
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache Gradle and wrapper
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant Permission for Gradlew to Execute
run: chmod +x gradlew
- name: Build AAR ⚙️🛠
run: bash ./gradlew :viewpagerdotsindicator:assemble
- name: Publish to GitLab Package Registry 🚀
run: bash ./gradlew :viewpagerdotsindicator:publish
env:
GPR_USER: ${{ github.actor }}
GPR_KEY: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLAB_REPO_URL: ${{ secrets.ANDROID_GITLAB_REPO_URL }}
GITLAB_DEPLOY_KEY: ${{ secrets.ANDROID_GITLAB_DEPLOY_KEY }}
GITLAB_DEPLOY_TOKEN: ${{ secrets.ANDROID_GITLAB_DEPLOY_TOKEN }}
- name: Create Release ✅
id: create_release
uses: actions/create-release@v1
env:
GPR_USER: ${{ github.actor }}
GPR_KEY: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLAB_REPO_URL: ${{ secrets.ANDROID_GITLAB_REPO_URL }}
GITLAB_DEPLOY_KEY: ${{ secrets.ANDROID_GITLAB_DEPLOY_KEY }}
GITLAB_DEPLOY_TOKEN: ${{ secrets.ANDROID_GITLAB_DEPLOY_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
- name: Upload OzanSuperApp's Library AAR 🗳
uses: actions/upload-release-asset@v1
env:
GPR_USER: ${{ github.actor }}
GPR_KEY: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLAB_REPO_URL: ${{ secrets.ANDROID_GITLAB_REPO_URL }}
GITLAB_DEPLOY_KEY: ${{ secrets.ANDROID_GITLAB_DEPLOY_KEY }}
GITLAB_DEPLOY_TOKEN: ${{ secrets.ANDROID_GITLAB_DEPLOY_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: viewpagerdotsindicator/build/outputs/aar/viewpagerdotsindicator-release.aar
asset_name: viewpagerdotsindicator.aar
asset_content_type: application/aar