-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (120 loc) · 4.23 KB
/
reusable-android-publish.yaml
File metadata and controls
130 lines (120 loc) · 4.23 KB
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
121
122
123
124
125
126
127
128
129
130
name: Reusable Android SDK publish to Sona
on:
workflow_call:
inputs:
appId:
required: true
type: string
description: 'App ID for committing and pushing'
PROPERTIES_FILE:
default: gradle.properties
type: string
description: Relative file path for putting in secrets
required: false
SIGNING_SECRET_KEY_RING_FILE:
default: com.rees46.key.gpg
type: string
description: Location and name for signature file
required: false
SIGNING_SECRET_KEY_RING_FILE_LOCATION:
type: string
description: Location and name for signature file
required: false
default: ./personalization-sdk
GRADLE_VERSION:
type: number
required: false
VARIANT_NAME:
description: REES46 or PersonaClick
type: string
required: true
URL:
description: GitHub repo URL
type: string
required: true
MAVEN_REPOSITORY_URL:
description: Maven repository publish to
type: string
required: true
OSSRH_USERNAME:
required: false
type: string
default: 'github-bot@rees46.com'
secrets:
appSecret:
required: true
SONATA_USERNAME:
required: true
SONATA_STAGING_PROFILE_ID:
required: true
SONATA_PASSWORD:
required: true
OSSRH_PASSWORD:
required: true
SIGNING_KEY_ID:
required: true
SIGNING_PASSWORD:
required: true
SIGNING_KEY_FILE_AS_BASE64_STRING:
required: true
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ inputs.appId }}
private-key: ${{ secrets.appSecret }}
- name: Checkout
uses: actions/checkout@v5
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Prepare Android Action
uses: rees46/workflow/.github/actions/android/prepare@master
with:
PROPERTIES_FILE: ${{ inputs.PROPERTIES_FILE }}
SIGNING_SECRET_KEY_RING_FILE: ${{ inputs.SIGNING_SECRET_KEY_RING_FILE }}
SIGNING_SECRET_KEY_RING_FILE_LOCATION: ${{ inputs.SIGNING_SECRET_KEY_RING_FILE_LOCATION }}
VARIANT_NAME: ${{ inputs.VARIANT_NAME }}
URL: ${{ inputs.URL }}
MAVEN_REPOSITORY_URL: ${{ inputs.MAVEN_REPOSITORY_URL }}
OSSRH_USERNAME: ${{ inputs.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATA_USERNAME: ${{ secrets.SONATA_USERNAME }}
SONATA_PASSWORD: ${{ secrets.SONATA_PASSWORD }}
SONATA_STAGING_PROFILE_ID: ${{ secrets.SONATA_STAGING_PROFILE_ID }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY_FILE_AS_BASE64_STRING: ${{ secrets.SIGNING_KEY_FILE_AS_BASE64_STRING }}
- name: Create staging repository
if: ${{ !cancelled() }}
uses: nexus-actions/create-nexus-staging-repo@990063f02160c633c168037b8b3e8585c76469fe
id: createStagingRepoStep
with:
username: ${{ secrets.SONATA_USERNAME }}
password: ${{ secrets.SONATA_PASSWORD }}
staging_profile_id: ${{ secrets.SONATA_STAGING_PROFILE_ID }}
base_url: 'https://s01.oss.sonatype.org/service/local/'
- name: Grant execute permission to gradlew
if: ${{ !cancelled() }}
run: chmod +x gradlew
- name: Clean gradlew cache
if: ${{ !cancelled() }}
run: |
./gradlew clean
- name: Publish
if: ${{ !cancelled() }}
env:
SONATYPE_REPOSITORY_ID: ${{ steps.createStagingRepoStep.outputs.repository_id }}
run: |
./gradlew publish -Psonatype
- name: Release
if: ${{ !cancelled() }}
uses: nexus-actions/release-nexus-staging-repo@6632a81bfab63557b2717e8423b0a620ae5aa414
with:
username: ${{ secrets.SONATA_USERNAME }}
password: ${{ secrets.SONATA_PASSWORD }}
staging_repository_id: ${{ steps.createStagingRepoStep.outputs.repository_id }}
base_url: 'https://s01.oss.sonatype.org/service/local/'