-
Notifications
You must be signed in to change notification settings - Fork 31
120 lines (97 loc) · 3.75 KB
/
publish-release.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Android Release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
monitor_permissions:
type: boolean
description: Monitor Permissions
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
build_release:
runs-on: ubuntu-latest
permissions:
pull-requests: 'write'
id-token: 'write'
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
if: ${{ github.event.inputs.monitor_permissions == 'true' }}
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-gradle
- uses: 1password/load-secrets-action/configure@v2
with:
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- id: op-secrets
uses: 1password/load-secrets-action@v2
with:
export-env: false
env:
GOOGLE_SERVICES: op://development/google services/playground release/base64
KEYSTORE_BASE64: op://development/playground keystore/keystore base64
KEYSTORE_PASSWORD: op://development/playground keystore/keystore password
KEY_ALIAS: op://development/playground keystore/key alias
KEY_PASSWORD: op://development/playground keystore/key password
- env:
GOOGLE_SERVICES: ${{ steps.op-secrets.outputs.GOOGLE_SERVICES }}
KEYSTORE_BASE64: ${{ steps.op-secrets.outputs.KEYSTORE_BASE64 }}
run: |
echo $GOOGLE_SERVICES | base64 --decode > conferences-app/google-services.json
echo $KEYSTORE_BASE64 | base64 --decode > keystore.jks
- uses: ./.github/actions/setup-cloud
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ID }}
setup_gcloud: false
- id: version-code
run: echo "VERSION_CODE=$(( (GITHUB_RUN_NUMBER * 2) + 1000 ))" >> $GITHUB_OUTPUT
- env:
ANDROID_API_KEY: ${{ secrets.ANDROID_API_KEY }}
BROWSER_API_KEY: ${{ secrets.BROWSER_API_KEY }}
KEY_STORE_FILE: keystore.jks
KEY_STORE_PASSWORD: ${{ steps.op-secrets.outputs.KEYSTORE_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ steps.op-secrets.outputs.KEY_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ steps.op-secrets.outputs.KEY_PASSWORD }}
SERVER_CLIENT_ID: ${{ secrets.SERVER_CLIENT_ID }}
VERSION_CODE: ${{ steps.version-code.outputs.VERSION_CODE }}
run: |
./gradlew \
:conferences-app:assemble \
:conferences-app:bundle \
--console=plain
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: android-build-outputs
path: conferences-app/build/outputs
publish_play_store:
needs: [ build_release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: android-build-outputs
path: conferences-app/build/outputs
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: 1password/load-secrets-action/configure@v2
with:
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- id: op-secrets
uses: 1password/load-secrets-action@v2
with:
export-env: false
env:
PLAY_STORE_KEY: op://development/service account key/base64
- env:
PLAY_STORE_KEY: ${{ steps.op-secrets.outputs.PLAY_STORE_KEY }}
run: |
echo $PLAY_STORE_KEY | base64 --decode > conferences-app/src/androidMain/play-store-key.json
- run: bundle exec fastlane android publish_to_play_store