-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (64 loc) · 2.92 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get tag version
id: get_version
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
- name: Set up environment
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2
bundler-cache: true
- name: Gradle build
run: ./gradlew build
env:
GH_DRIVER_REPOSITORY_USERNAME: ${{ secrets.GH_DRIVER_REPOSITORY_USERNAME }}
GH_DRIVER_REPOSITORY_TOKEN: ${{ secrets.GH_DRIVER_REPOSITORY_TOKEN }}
- name: Publish the library to MavenCentral
run: ./gradlew publish
env:
OSSRH_LOGIN: ${{ secrets.OSSRH_LOGIN }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGN_KEYID: ${{ secrets.SIGN_KEYID }}
SIGN_KEY: ${{ secrets.SIGN_KEY }}
SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }}
LIB_VERSION: ${{ steps.get_version.outputs.VERSION }}
GH_DRIVER_REPOSITORY_USERNAME: ${{ secrets.GH_DRIVER_REPOSITORY_USERNAME }}
GH_DRIVER_REPOSITORY_TOKEN: ${{ secrets.GH_DRIVER_REPOSITORY_TOKEN }}
# - name: Rename the AAR file for GitHub release upload
# run: mv enioka_scan/build/outputs/aar/enioka_scan-release.aar enioka_scan/build/outputs/aar/enioka_scan-${{ steps.get_version.outputs.VERSION }}.aar
- name: Restore json key
run: echo "${{ secrets.GOOGLE_API_PUB_JSON_BASE64 }}" | base64 --decode > ${{ github.workspace }}/service-account.json
- name: Restore keystore
run: echo "${{ secrets.GOOGLE_KEYSTORE_BASE64 }}" | base64 --decode > ${{ github.workspace }}/demoscannerapp/debug.keystore
- name: Fastlane build and upload
run: bundle exec fastlane internal
env:
KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_KEYSTORE_PASSWORD }}
SIGNKEY_PASSWORD: ${{ secrets.GOOGLE_SIGNKEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.GOOGLE_SIGNKEY_ALIAS }}
- name: Rename the AAB file for GitHub release upload
run: mv demoscannerapp/build/outputs/bundle/release/demoscannerapp-release.aab demoscannerapp/build/outputs/bundle/release/enioka_scan-${{ steps.get_version.outputs.VERSION }}.aab
- name: Create a GitHub release with the AAR file as an asset
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.get_version.outputs.VERSION }}
files: |
# enioka_scan/build/outputs/aar/enioka_scan-${{ steps.get_version.outputs.VERSION }}.aar
demoscannerapp/build/outputs/bundle/release/enioka_scan-${{ steps.get_version.outputs.VERSION }}.aab
token: ${{ secrets.GITHUB_TOKEN }}