-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.84 KB
/
android-sdk.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
75
76
77
name: WalletAndroid-SDK
on:
push:
branches:
- main
- staging
- dev
- VL-6481-fix
env:
PACKAGE_TYPE: "aar"
GRADLE_VERSION: "7.5"
JAVA_VERSION: "11"
ARTIFACT_PATH: "VCL/build/outputs"
ANDROID_NEXUS_SIGNING_KEY_ID: ${{ secrets.ANDROID_NEXUS_SIGNING_KEY_ID }}
ANDROID_NEXUS_SIGNING_PWD: ${{ secrets.ANDROID_NEXUS_SIGNING_PWD }}
ANDROID_NEXUS_OSSRH_USERNAME: ${{ secrets.ANDROID_NEXUS_OSSRH_USERNAME }}
ANDROID_NEXUS_OSSRH_PWD: ${{ secrets.ANDROID_NEXUS_OSSRH_PWD }}
ANDROID_NEXUS_STAGING_PROFILE_ID: ${{ secrets.ANDROID_NEXUS_STAGING_PROFILE_ID }}
ANDROID_NEXUS_PRIVATE_KEY: ${{ secrets.ANDROID_NEXUS_PRIVATE_KEY }}
jobs:
test-android-sdk:
runs-on: ubuntu-latest
steps:
- name: Git clone repository
uses: actions/checkout@v4
# Setup java
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
# Run test
- name: Run Test
run: ./gradlew test
build-android-sdk:
runs-on: ubuntu-latest
needs:
- test-android-sdk
steps:
- name: Git clone repository
uses: actions/checkout@v4
# Setup java
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
# Gradle Assemble
- name: Gradle Assemble
run: ./gradlew assemble${{ env.RELEASE_TAG }}
env:
RELEASE_TAG: ${{ github.ref == 'refs/heads/main' && format('{0}', 'Release' ) || 'Rc' }}
# Convert artifact to lowercase
- name: Rename artifact to lowercase
run: mv ${{ env.ARTIFACT_PATH}}/${{ env.PACKAGE_TYPE }}/VCL-${{ env.RELEASE_TAG }}.${{ env.PACKAGE_TYPE }} ${{ env.ARTIFACT_PATH }}/${{ env.PACKAGE_TYPE }}/vcl-${{ env.RELEASE_TAG }}.${{ env.PACKAGE_TYPE }}
env:
RELEASE_TAG: ${{ github.ref == 'refs/heads/main' && format('{0}', 'release' ) || 'rc' }}
# Show Me Builded packages
- name: Show Me Builded packages
run: ls -al ${{ env.ARTIFACT_PATH}}/${{ env.PACKAGE_TYPE }}/
# Publish Main/Staging
- name: Publish Main/Staging
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/VL-6481-fix' }}
run: ./gradlew publish${{ env.RELEASE_TAG }}
env:
RELEASE_TAG: ${{ github.ref == 'refs/heads/main' && format('{0}', 'Release' ) || 'Rc' }}
# Upload Artifacts
- name: Upload Artifact
if: success()
uses: actions/upload-artifact@v3
with:
name: vcl-${{ env.RELEASE_TAG }}.${{ env.PACKAGE_TYPE }}
path: ${{ env.ARTIFACT_PATH }}/${{ env.PACKAGE_TYPE }}
if-no-files-found: error
retention-days: 1
env:
RELEASE_TAG: ${{ github.ref == 'refs/heads/main' && format('{0}', 'release' ) || 'rc' }}