Skip to content

Commit 6e867b2

Browse files
authored
chore: add Github action to create release PR (#164)
1 parent b438686 commit 6e867b2

File tree

11 files changed

+356
-4
lines changed

11 files changed

+356
-4
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
- [ ] Added Unit Tests
1616
- [ ] Added Integration Tests
1717
- [ ] Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
18+
- [ ] Ensure commit message has the appropriate scope (e.g `fix(liveness): message`, `fix(authenticator): message`, `fix(all): message`)
1819

1920
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

.github/workflows/release_pr.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Prepare Next Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
component:
6+
type: choice
7+
description: Component to release
8+
required: true
9+
options:
10+
- Authenticator
11+
- Liveness
12+
release_tag:
13+
description: 'Release Tag'
14+
required: false
15+
type: string
16+
env:
17+
GIT_USER_NAME: amplify-android-dev+ghops
18+
GIT_USER_EMAIL: [email protected]
19+
BASE_BRANCH: ${{ github.ref_name }}
20+
jobs:
21+
create_pr_for_next_release:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Update git
25+
run: |
26+
sudo add-apt-repository -y ppa:git-core/ppa
27+
sudo apt-get update
28+
sudo apt-get install git -y
29+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
30+
with:
31+
ref: ${{ env.BASE_BRANCH }}
32+
fetch-depth: 0
33+
- name: Set up Ruby
34+
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
35+
with:
36+
ruby-version: "3.0"
37+
- name: Install dependencies
38+
run: |
39+
cd scripts
40+
gem install bundler
41+
bundle install --full-index
42+
- name: Configure git options
43+
run: |
44+
cd scripts
45+
bundle exec fastlane android configure_git_options git_user_email:$GIT_USER_EMAIL git_user_name:$GIT_USER_NAME
46+
- name: Create/checkout a branch for the release
47+
run: |
48+
branch_name=bump_version_${{ env.BASE_BRANCH }}
49+
git fetch --all
50+
(git branch -D $branch_name &>/dev/null) && (echo 'Existing $branch_name branch deleted') || (echo 'No existing $branch_name branch to delete.')
51+
git checkout -b $branch_name
52+
- name: Create PR for next release
53+
env:
54+
RELEASE_MANAGER_TOKEN: ${{secrets.GITHUB_TOKEN}}
55+
RELEASE_TAG: ${{ github.event.inputs.release_tag }}
56+
run: |
57+
cd scripts
58+
bundle exec fastlane android create_next_release_pr release_tag:"$RELEASE_TAG" base_branch:"$BASE_BRANCH" release_component_target:"$COMPONENT"

samples/authenticator/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies {
5252
// or
5353

5454
// Use this to use published version of Amplify UI
55-
implementation "com.amplifyframework.ui:authenticator:$authenticatorVersion"
55+
implementation "com.amplifyframework.ui:authenticator:$AuthenticatorVersion"
5656

5757
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
5858
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'

samples/authenticator/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
buildscript {
22
ext {
33
compose_version = '1.5.4'
4-
authenticatorVersion = '1.2.1'
4+
AuthenticatorVersion = '1.2.1'
55
}
66
repositories {
77
google()

samples/liveness/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ dependencies {
5858
// or
5959

6060
// Use this to use published version of Amplify UI
61-
implementation "com.amplifyframework.ui:liveness:$amplifyUIVersion"
61+
implementation "com.amplifyframework.ui:liveness:$LivenessVersion"
6262

6363
implementation "com.amplifyframework:core-kotlin:$amplifyVersion"
6464
implementation "com.amplifyframework:aws-api:$amplifyVersion"

samples/liveness/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ buildscript {
22
ext {
33
compose_version = '1.5.4'
44
amplifyVersion = '2.15.1'
5-
amplifyUIVersion = '1.2.6'
5+
LivenessVersion = '1.2.6'
66
}
77
repositories {
88
google()

scripts/Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source "https://rubygems.org"
2+
3+
gem "fastlane"
4+
gem "addressable", ">= 2.8.0"
5+
6+
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
7+
eval_gemfile(plugins_path) if File.exist?(plugins_path)

scripts/Gemfile.lock

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
GIT
2+
remote: https://github.com/aws-amplify/amplify-ci-support
3+
revision: a9fba40726da12b662c750010598e42ea071fafb
4+
branch: android/fastlane-actions
5+
glob: src/fastlane/release_actions/*.gemspec
6+
specs:
7+
fastlane-plugin-release_actions (1.1.0)
8+
9+
GEM
10+
remote: https://rubygems.org/
11+
specs:
12+
CFPropertyList (3.0.7)
13+
base64
14+
nkf
15+
rexml
16+
addressable (2.8.7)
17+
public_suffix (>= 2.0.2, < 7.0)
18+
artifactory (3.0.17)
19+
atomos (0.1.3)
20+
aws-eventstream (1.3.0)
21+
aws-partitions (1.950.0)
22+
aws-sdk-core (3.200.0)
23+
aws-eventstream (~> 1, >= 1.3.0)
24+
aws-partitions (~> 1, >= 1.651.0)
25+
aws-sigv4 (~> 1.8)
26+
jmespath (~> 1, >= 1.6.1)
27+
aws-sdk-kms (1.87.0)
28+
aws-sdk-core (~> 3, >= 3.199.0)
29+
aws-sigv4 (~> 1.1)
30+
aws-sdk-s3 (1.155.0)
31+
aws-sdk-core (~> 3, >= 3.199.0)
32+
aws-sdk-kms (~> 1)
33+
aws-sigv4 (~> 1.8)
34+
aws-sigv4 (1.8.0)
35+
aws-eventstream (~> 1, >= 1.0.2)
36+
babosa (1.0.4)
37+
base64 (0.2.0)
38+
claide (1.1.0)
39+
colored (1.2)
40+
colored2 (3.1.2)
41+
commander (4.6.0)
42+
highline (~> 2.0.0)
43+
declarative (0.0.20)
44+
digest-crc (0.6.5)
45+
rake (>= 12.0.0, < 14.0.0)
46+
domain_name (0.6.20240107)
47+
dotenv (2.8.1)
48+
emoji_regex (3.2.3)
49+
excon (0.110.0)
50+
faraday (1.10.3)
51+
faraday-em_http (~> 1.0)
52+
faraday-em_synchrony (~> 1.0)
53+
faraday-excon (~> 1.1)
54+
faraday-httpclient (~> 1.0)
55+
faraday-multipart (~> 1.0)
56+
faraday-net_http (~> 1.0)
57+
faraday-net_http_persistent (~> 1.0)
58+
faraday-patron (~> 1.0)
59+
faraday-rack (~> 1.0)
60+
faraday-retry (~> 1.0)
61+
ruby2_keywords (>= 0.0.4)
62+
faraday-cookie_jar (0.0.7)
63+
faraday (>= 0.8.0)
64+
http-cookie (~> 1.0.0)
65+
faraday-em_http (1.0.0)
66+
faraday-em_synchrony (1.0.0)
67+
faraday-excon (1.1.0)
68+
faraday-httpclient (1.0.1)
69+
faraday-multipart (1.0.4)
70+
multipart-post (~> 2)
71+
faraday-net_http (1.0.1)
72+
faraday-net_http_persistent (1.2.0)
73+
faraday-patron (1.0.0)
74+
faraday-rack (1.0.0)
75+
faraday-retry (1.0.3)
76+
faraday_middleware (1.2.0)
77+
faraday (~> 1.0)
78+
fastimage (2.3.1)
79+
fastlane (2.221.1)
80+
CFPropertyList (>= 2.3, < 4.0.0)
81+
addressable (>= 2.8, < 3.0.0)
82+
artifactory (~> 3.0)
83+
aws-sdk-s3 (~> 1.0)
84+
babosa (>= 1.0.3, < 2.0.0)
85+
bundler (>= 1.12.0, < 3.0.0)
86+
colored (~> 1.2)
87+
commander (~> 4.6)
88+
dotenv (>= 2.1.1, < 3.0.0)
89+
emoji_regex (>= 0.1, < 4.0)
90+
excon (>= 0.71.0, < 1.0.0)
91+
faraday (~> 1.0)
92+
faraday-cookie_jar (~> 0.0.6)
93+
faraday_middleware (~> 1.0)
94+
fastimage (>= 2.1.0, < 3.0.0)
95+
gh_inspector (>= 1.1.2, < 2.0.0)
96+
google-apis-androidpublisher_v3 (~> 0.3)
97+
google-apis-playcustomapp_v1 (~> 0.1)
98+
google-cloud-env (>= 1.6.0, < 2.0.0)
99+
google-cloud-storage (~> 1.31)
100+
highline (~> 2.0)
101+
http-cookie (~> 1.0.5)
102+
json (< 3.0.0)
103+
jwt (>= 2.1.0, < 3)
104+
mini_magick (>= 4.9.4, < 5.0.0)
105+
multipart-post (>= 2.0.0, < 3.0.0)
106+
naturally (~> 2.2)
107+
optparse (>= 0.1.1, < 1.0.0)
108+
plist (>= 3.1.0, < 4.0.0)
109+
rubyzip (>= 2.0.0, < 3.0.0)
110+
security (= 0.1.5)
111+
simctl (~> 1.6.3)
112+
terminal-notifier (>= 2.0.0, < 3.0.0)
113+
terminal-table (~> 3)
114+
tty-screen (>= 0.6.3, < 1.0.0)
115+
tty-spinner (>= 0.8.0, < 1.0.0)
116+
word_wrap (~> 1.0.0)
117+
xcodeproj (>= 1.13.0, < 2.0.0)
118+
xcpretty (~> 0.3.0)
119+
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
120+
fastlane-plugin-semantic_release (1.18.2)
121+
gh_inspector (1.1.3)
122+
google-apis-androidpublisher_v3 (0.54.0)
123+
google-apis-core (>= 0.11.0, < 2.a)
124+
google-apis-core (0.11.3)
125+
addressable (~> 2.5, >= 2.5.1)
126+
googleauth (>= 0.16.2, < 2.a)
127+
httpclient (>= 2.8.1, < 3.a)
128+
mini_mime (~> 1.0)
129+
representable (~> 3.0)
130+
retriable (>= 2.0, < 4.a)
131+
rexml
132+
google-apis-iamcredentials_v1 (0.17.0)
133+
google-apis-core (>= 0.11.0, < 2.a)
134+
google-apis-playcustomapp_v1 (0.13.0)
135+
google-apis-core (>= 0.11.0, < 2.a)
136+
google-apis-storage_v1 (0.31.0)
137+
google-apis-core (>= 0.11.0, < 2.a)
138+
google-cloud-core (1.7.0)
139+
google-cloud-env (>= 1.0, < 3.a)
140+
google-cloud-errors (~> 1.0)
141+
google-cloud-env (1.6.0)
142+
faraday (>= 0.17.3, < 3.0)
143+
google-cloud-errors (1.4.0)
144+
google-cloud-storage (1.47.0)
145+
addressable (~> 2.8)
146+
digest-crc (~> 0.4)
147+
google-apis-iamcredentials_v1 (~> 0.1)
148+
google-apis-storage_v1 (~> 0.31.0)
149+
google-cloud-core (~> 1.6)
150+
googleauth (>= 0.16.2, < 2.a)
151+
mini_mime (~> 1.0)
152+
googleauth (1.8.1)
153+
faraday (>= 0.17.3, < 3.a)
154+
jwt (>= 1.4, < 3.0)
155+
multi_json (~> 1.11)
156+
os (>= 0.9, < 2.0)
157+
signet (>= 0.16, < 2.a)
158+
highline (2.0.3)
159+
http-cookie (1.0.6)
160+
domain_name (~> 0.5)
161+
httpclient (2.8.3)
162+
jmespath (1.6.2)
163+
json (2.7.2)
164+
jwt (2.8.2)
165+
base64
166+
mini_magick (4.13.1)
167+
mini_mime (1.1.5)
168+
multi_json (1.15.0)
169+
multipart-post (2.4.1)
170+
nanaimo (0.3.0)
171+
naturally (2.2.1)
172+
nkf (0.2.0)
173+
optparse (0.5.0)
174+
os (1.1.4)
175+
plist (3.7.1)
176+
public_suffix (6.0.0)
177+
rake (13.2.1)
178+
representable (3.2.0)
179+
declarative (< 0.1.0)
180+
trailblazer-option (>= 0.1.1, < 0.2.0)
181+
uber (< 0.2.0)
182+
retriable (3.1.2)
183+
rexml (3.2.9)
184+
strscan
185+
rouge (2.0.7)
186+
ruby2_keywords (0.0.5)
187+
rubyzip (2.3.2)
188+
security (0.1.5)
189+
signet (0.19.0)
190+
addressable (~> 2.8)
191+
faraday (>= 0.17.5, < 3.a)
192+
jwt (>= 1.5, < 3.0)
193+
multi_json (~> 1.10)
194+
simctl (1.6.10)
195+
CFPropertyList
196+
naturally
197+
strscan (3.1.0)
198+
terminal-notifier (2.0.0)
199+
terminal-table (3.0.2)
200+
unicode-display_width (>= 1.1.1, < 3)
201+
trailblazer-option (0.1.2)
202+
tty-cursor (0.7.1)
203+
tty-screen (0.8.2)
204+
tty-spinner (0.9.3)
205+
tty-cursor (~> 0.7)
206+
uber (0.1.0)
207+
unicode-display_width (2.5.0)
208+
word_wrap (1.0.0)
209+
xcodeproj (1.24.0)
210+
CFPropertyList (>= 2.3.3, < 4.0)
211+
atomos (~> 0.1.3)
212+
claide (>= 1.0.2, < 2.0)
213+
colored2 (~> 3.1)
214+
nanaimo (~> 0.3.0)
215+
rexml (~> 3.2.4)
216+
xcpretty (0.3.0)
217+
rouge (~> 2.0.7)
218+
xcpretty-travis-formatter (1.0.1)
219+
xcpretty (~> 0.2, >= 0.0.7)
220+
221+
PLATFORMS
222+
arm64-darwin-21
223+
224+
DEPENDENCIES
225+
addressable (>= 2.8.0)
226+
fastlane
227+
fastlane-plugin-release_actions!
228+
fastlane-plugin-semantic_release
229+
230+
BUNDLED WITH
231+
2.3.7

scripts/fastlane/Appfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
2+
package_name("com.amplifyframework.ui") # e.g. com.krausefx.app

scripts/fastlane/Fastfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
default_platform(:android)
2+
3+
import_from_git(
4+
url: 'https://github.com/aws-amplify/amplify-ci-support',
5+
branch: 'android/fastlane-actions',
6+
path: './src/fastlane/release_actions/fastlane/AndroidAppsFastfile'
7+
)
8+
9+
# When testing against local changes, comment out the above and use the line below instead.
10+
# import '~/github/aws-amplify/amplify-ci-support/src/fastlane/release_actions/fastlane/AndroidAppsFastfile'
11+
12+
platform :android do |options|
13+
override_lane :build_parameters do
14+
project_root = File.expand_path("#{Dir.pwd()}/../..")
15+
UI.message("Building version groups for amplify-ui-android from #{project_root}")
16+
{
17+
repo: 'aws-amplify/amplify-ui-android',
18+
product_name: 'Amplify UI Liveness Android',
19+
releases: [
20+
{
21+
release_tag_prefix: 'release_liveness_v',
22+
gradle_properties_path: "#{project_root}/liveness/gradle.properties",
23+
doc_files_to_update: [],
24+
release_title: 'Amplify UI Liveness Android',
25+
changelog_path: "#{project_root}/liveness/CHANGELOG.md",
26+
component_name: "Liveness",
27+
top_level_docs_to_update: ["#{project_root}/README.md"],
28+
sample_build_files_to_update: ["#{project_root}/samples/liveness/build.gradle"],
29+
changelog_include_scopes: ["liveness", "Liveness", "all"],
30+
changelog_ignore_scopes: ["authenticator", "Authenticator"]
31+
},
32+
{
33+
release_tag_prefix: 'release_authenticator_v',
34+
gradle_properties_path: "#{project_root}/authenticator/gradle.properties",
35+
doc_files_to_update: ["#{project_root}/authenticator/README.md"],
36+
release_title: 'Amplify UI Authenticator Android',
37+
changelog_path: "#{project_root}/authenticator/CHANGELOG.md",
38+
component_name: "Authenticator",
39+
top_level_docs_to_update: ["#{project_root}/README.md"],
40+
sample_build_files_to_update: ["#{project_root}/samples/authenticator/build.gradle"],
41+
changelog_include_scopes: ["authenticator", "Authenticator", "all"],
42+
changelog_ignore_scopes: ["liveness", "Liveness"]
43+
}
44+
]
45+
}
46+
end
47+
end

0 commit comments

Comments
 (0)