Skip to content

Commit 49cc326

Browse files
authored
Merge pull request #185 from qonversion/release/4.6.1
Release 4.6.1
2 parents cbb1262 + a0f3c69 commit 49cc326

File tree

13 files changed

+186
-51
lines changed

13 files changed

+186
-51
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Manual Minor Prerelease
2+
3+
on:
4+
workflow_dispatch
5+
6+
jobs:
7+
patch-minor:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Minor
12+
run: |
13+
fastlane minor
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Manual Patch Prerelease
2+
3+
on:
4+
workflow_dispatch
5+
6+
jobs:
7+
patch-prerelease:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Patch
12+
run: |
13+
fastlane patch
Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,9 @@
1-
name: Release pull requests
1+
name: Release pull requests from dev by tag
22
on:
33
push:
44
tags:
5-
- prerelease/*
5+
- prerelease/*
66

77
jobs:
8-
prerelease:
9-
runs-on: macos-latest
10-
11-
steps:
12-
- uses: actions/checkout@v2
13-
name: Checkout all
14-
with:
15-
fetch-depth: 0
16-
17-
- uses: olegtarasov/[email protected]
18-
id: tagName
19-
with:
20-
tagRegex: 'prerelease\/(\d*\.\d*\.\d*)'
21-
22-
- name: Bump version
23-
run: |
24-
fastlane bump version:${{ steps.tagName.outputs.tag }}
25-
26-
- name: Create pull request
27-
uses: peter-evans/create-pull-request@v3
28-
with:
29-
title: Release ${{ steps.tagName.outputs.tag }}
30-
body: Release PR
31-
labels: autocreated
32-
branch: release/${{ steps.tagName.outputs.tag }}
33-
base: develop
34-
35-
- uses: actions/checkout@v2
36-
with:
37-
ref: main
38-
39-
- name: Reset main branch
40-
run: |
41-
git fetch origin release/${{ steps.tagName.outputs.tag }}:release/${{ steps.tagName.outputs.tag }}
42-
git reset --hard release/${{ steps.tagName.outputs.tag }}
43-
44-
- name: Create Pull Request
45-
uses: peter-evans/create-pull-request@v3
46-
with:
47-
title: Release ${{ steps.tagName.outputs.tag }}
48-
body: Release PR
49-
labels: autocreated
50-
branch: release/${{ steps.tagName.outputs.tag }}
51-
base: main
8+
handle_prerelease:
9+
uses: qonversion/shared-sdk-workflows/.github/workflows/prerelease_handling.yml@main

.github/workflows/stale_issues.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Close stale issues
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
jobs:
7+
stale_issues:
8+
uses: qonversion/shared-sdk-workflows/.github/workflows/stale_issues.yml@main
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Upgrade Sandwich
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
sandwich_version:
6+
description: 'Sandwich version'
7+
required: true
8+
default: '0.0.0'
9+
10+
jobs:
11+
upgrade:
12+
uses: qonversion/shared-sdk-workflows/.github/workflows/upgrade_sandwich.yml@main
13+
with:
14+
sandwich_version: ${{ github.event.inputs.sandwich_version }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.6.1
2+
* Fixed an issue causing automation event losses on Android.
3+
* Fixed a rare issue with the permissions cache on Android.
4+
15
## 4.6.0
26
* Added a `source` property to the `Permission` object - use it to know where this permission is originally from - App Store, Play Store, Stripe, etc.
37
* Added a method `getNotificationCustomPayload` to get the extra data you've added to automation notifications.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ android {
4141

4242
dependencies {
4343
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
44-
implementation 'io.qonversion.sandwich:sandwich:0.2.0'
44+
implementation "io.qonversion.sandwich:sandwich:0.2.1"
4545
implementation 'com.google.code.gson:gson:2.8.6'
4646
}

fastlane/Fastfile

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,103 @@ def update_changelog(new_version)
2929
}
3030
end
3131

32+
def upgrade_sandwich_android(new_version)
33+
path = "../android/build.gradle"
34+
common_part = "implementation \"io.qonversion.sandwich:sandwich:"
35+
regex = /#{common_part}.*"/
36+
result_value = "#{common_part}#{new_version}\""
37+
38+
update_file(path, regex, result_value)
39+
end
40+
41+
def upgrade_sandwich_apple(platform, new_version)
42+
path = "../#{platform}/qonversion_flutter.podspec"
43+
common_part = "s.dependency \"QonversionSandwich\", \""
44+
regex = /#{common_part}.*"/
45+
result_value = "#{common_part}#{new_version}\""
46+
47+
update_file(path, regex, result_value)
48+
end
49+
50+
def update_file(path, regex, result_value)
51+
file = File.read(path)
52+
new_content = file.gsub(regex, result_value)
53+
File.open(path, 'w') { |line| line.puts new_content }
54+
end
55+
56+
def get_tag
57+
tag = last_git_tag()
58+
puts tag
59+
result_tag = tag.scan(%r{\d{1,2}.\d{1,2}.\d{1,3}}).first
60+
return result_tag
61+
end
62+
63+
def calculate_minor_version(tag)
64+
major, minor, patch = parse_versions(tag)
65+
new_minor_version = minor.to_i.next.to_s
66+
new_version = major + "." + new_minor_version + "." + "0"
67+
return new_version
68+
end
69+
70+
def calculate_patch_version(tag)
71+
major, minor, patch = parse_versions(tag)
72+
new_patch_version = patch.to_i.next.to_s
73+
new_version = major + "." + minor + "." + new_patch_version
74+
75+
return new_version
76+
end
77+
78+
def push_tag(tag)
79+
system("git checkout develop")
80+
system("git pull origin develop")
81+
add_git_tag(tag: tag)
82+
push_git_tags(tag: tag)
83+
end
84+
85+
def parse_versions(tag)
86+
split_version_array = tag.split(".", 3)
87+
88+
if split_version_array.length == 3
89+
major = split_version_array[0]
90+
minor = split_version_array[1]
91+
patch = split_version_array[2]
92+
93+
return major, minor, patch
94+
end
95+
end
96+
97+
lane :patch do
98+
tag = get_tag
99+
new_version = calculate_patch_version(tag)
100+
new_tag = "prerelease/" + new_version
101+
push_tag(new_tag)
102+
end
103+
104+
lane :minor do
105+
tag = get_tag
106+
new_version = calculate_minor_version(tag)
107+
new_tag = "prerelease/" + new_version
108+
push_tag(new_tag)
109+
end
110+
32111
lane :bump do |options|
33112
new_version = options[:version]
34113

35114
update_dart(new_version)
36115
update_yaml(new_version)
37116
update_changelog(new_version)
38117
end
118+
119+
lane :upgrade_sandwich do |options|
120+
new_version = options[:version]
121+
122+
upgrade_sandwich_android(new_version)
123+
upgrade_sandwich_apple("ios", new_version)
124+
upgrade_sandwich_apple("macos", new_version)
125+
end
126+
127+
lane :provide_next_patch_version do
128+
tag = get_tag
129+
new_version = calculate_patch_version(tag)
130+
sh("echo version=#{new_version} >> \"$GITHUB_ENV\"")
131+
end

fastlane/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do
1313

1414
# Available Actions
1515

16+
### patch
17+
18+
```sh
19+
[bundle exec] fastlane patch
20+
```
21+
22+
23+
24+
### minor
25+
26+
```sh
27+
[bundle exec] fastlane minor
28+
```
29+
30+
31+
1632
### bump
1733

1834
```sh
@@ -21,6 +37,22 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do
2137

2238

2339

40+
### upgrade_sandwich
41+
42+
```sh
43+
[bundle exec] fastlane upgrade_sandwich
44+
```
45+
46+
47+
48+
### provide_next_patch_version
49+
50+
```sh
51+
[bundle exec] fastlane provide_next_patch_version
52+
```
53+
54+
55+
2456
----
2557

2658
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

ios/qonversion_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
s.source_files = 'Classes/**/*'
1717
s.dependency 'Flutter'
1818
s.platform = :ios, '9.0'
19-
s.dependency 'QonversionSandwich', '0.2.0'
19+
s.dependency "QonversionSandwich", "0.2.1"
2020

2121
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
2222
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }

0 commit comments

Comments
 (0)