Skip to content

Commit

Permalink
Merge pull request #185 from qonversion/release/4.6.1
Browse files Browse the repository at this point in the history
Release 4.6.1
  • Loading branch information
SpertsyanKM authored Nov 16, 2022
2 parents cbb1262 + a0f3c69 commit 49cc326
Show file tree
Hide file tree
Showing 13 changed files with 186 additions and 51 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/manual_minor_prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Manual Minor Prerelease

on:
workflow_dispatch

jobs:
patch-minor:
runs-on: ubuntu-latest

steps:
- name: Minor
run: |
fastlane minor
13 changes: 13 additions & 0 deletions .github/workflows/manual_patch_prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Manual Patch Prerelease

on:
workflow_dispatch

jobs:
patch-prerelease:
runs-on: ubuntu-latest

steps:
- name: Patch
run: |
fastlane patch
50 changes: 4 additions & 46 deletions .github/workflows/release_pull_requests.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,9 @@
name: Release pull requests
name: Release pull requests from dev by tag
on:
push:
tags:
- prerelease/*
- prerelease/*

jobs:
prerelease:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
name: Checkout all
with:
fetch-depth: 0

- uses: olegtarasov/get-tag@v2.1
id: tagName
with:
tagRegex: 'prerelease\/(\d*\.\d*\.\d*)'

- name: Bump version
run: |
fastlane bump version:${{ steps.tagName.outputs.tag }}
- name: Create pull request
uses: peter-evans/create-pull-request@v3
with:
title: Release ${{ steps.tagName.outputs.tag }}
body: Release PR
labels: autocreated
branch: release/${{ steps.tagName.outputs.tag }}
base: develop

- uses: actions/checkout@v2
with:
ref: main

- name: Reset main branch
run: |
git fetch origin release/${{ steps.tagName.outputs.tag }}:release/${{ steps.tagName.outputs.tag }}
git reset --hard release/${{ steps.tagName.outputs.tag }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: Release ${{ steps.tagName.outputs.tag }}
body: Release PR
labels: autocreated
branch: release/${{ steps.tagName.outputs.tag }}
base: main
handle_prerelease:
uses: qonversion/shared-sdk-workflows/.github/workflows/prerelease_handling.yml@main
8 changes: 8 additions & 0 deletions .github/workflows/stale_issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Close stale issues
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale_issues:
uses: qonversion/shared-sdk-workflows/.github/workflows/stale_issues.yml@main
14 changes: 14 additions & 0 deletions .github/workflows/upgrade_sandwich.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Upgrade Sandwich
on:
workflow_dispatch:
inputs:
sandwich_version:
description: 'Sandwich version'
required: true
default: '0.0.0'

jobs:
upgrade:
uses: qonversion/shared-sdk-workflows/.github/workflows/upgrade_sandwich.yml@main
with:
sandwich_version: ${{ github.event.inputs.sandwich_version }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.6.1
* Fixed an issue causing automation event losses on Android.
* Fixed a rare issue with the permissions cache on Android.

## 4.6.0
* Added a `source` property to the `Permission` object - use it to know where this permission is originally from - App Store, Play Store, Stripe, etc.
* Added a method `getNotificationCustomPayload` to get the extra data you've added to automation notifications.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'io.qonversion.sandwich:sandwich:0.2.0'
implementation "io.qonversion.sandwich:sandwich:0.2.1"
implementation 'com.google.code.gson:gson:2.8.6'
}
93 changes: 93 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,103 @@ def update_changelog(new_version)
}
end

def upgrade_sandwich_android(new_version)
path = "../android/build.gradle"
common_part = "implementation \"io.qonversion.sandwich:sandwich:"
regex = /#{common_part}.*"/
result_value = "#{common_part}#{new_version}\""

update_file(path, regex, result_value)
end

def upgrade_sandwich_apple(platform, new_version)
path = "../#{platform}/qonversion_flutter.podspec"
common_part = "s.dependency \"QonversionSandwich\", \""
regex = /#{common_part}.*"/
result_value = "#{common_part}#{new_version}\""

update_file(path, regex, result_value)
end

def update_file(path, regex, result_value)
file = File.read(path)
new_content = file.gsub(regex, result_value)
File.open(path, 'w') { |line| line.puts new_content }
end

def get_tag
tag = last_git_tag()
puts tag
result_tag = tag.scan(%r{\d{1,2}.\d{1,2}.\d{1,3}}).first
return result_tag
end

def calculate_minor_version(tag)
major, minor, patch = parse_versions(tag)
new_minor_version = minor.to_i.next.to_s
new_version = major + "." + new_minor_version + "." + "0"
return new_version
end

def calculate_patch_version(tag)
major, minor, patch = parse_versions(tag)
new_patch_version = patch.to_i.next.to_s
new_version = major + "." + minor + "." + new_patch_version

return new_version
end

def push_tag(tag)
system("git checkout develop")
system("git pull origin develop")
add_git_tag(tag: tag)
push_git_tags(tag: tag)
end

def parse_versions(tag)
split_version_array = tag.split(".", 3)

if split_version_array.length == 3
major = split_version_array[0]
minor = split_version_array[1]
patch = split_version_array[2]

return major, minor, patch
end
end

lane :patch do
tag = get_tag
new_version = calculate_patch_version(tag)
new_tag = "prerelease/" + new_version
push_tag(new_tag)
end

lane :minor do
tag = get_tag
new_version = calculate_minor_version(tag)
new_tag = "prerelease/" + new_version
push_tag(new_tag)
end

lane :bump do |options|
new_version = options[:version]

update_dart(new_version)
update_yaml(new_version)
update_changelog(new_version)
end

lane :upgrade_sandwich do |options|
new_version = options[:version]

upgrade_sandwich_android(new_version)
upgrade_sandwich_apple("ios", new_version)
upgrade_sandwich_apple("macos", new_version)
end

lane :provide_next_patch_version do
tag = get_tag
new_version = calculate_patch_version(tag)
sh("echo version=#{new_version} >> \"$GITHUB_ENV\"")
end
32 changes: 32 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do

# Available Actions

### patch

```sh
[bundle exec] fastlane patch
```



### minor

```sh
[bundle exec] fastlane minor
```



### bump

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



### upgrade_sandwich

```sh
[bundle exec] fastlane upgrade_sandwich
```



### provide_next_patch_version

```sh
[bundle exec] fastlane provide_next_patch_version
```



----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
Expand Down
2 changes: 1 addition & 1 deletion ios/qonversion_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '9.0'
s.dependency 'QonversionSandwich', '0.2.0'
s.dependency "QonversionSandwich", "0.2.1"

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
Expand Down
2 changes: 1 addition & 1 deletion lib/src/qonversion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'models/purchase_exception.dart';
import 'qa_provider.dart';

class Qonversion {
static const String _sdkVersion = "4.6.0";
static const String _sdkVersion = "4.6.1";

static const MethodChannel _channel = MethodChannel('qonversion_flutter_sdk');

Expand Down
2 changes: 1 addition & 1 deletion macos/qonversion_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.dependency 'FlutterMacOS'
s.platform = :osx, '10.12'
s.dependency 'QonversionSandwich', '0.2.0'
s.dependency "QonversionSandwich", "0.2.1"
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
s.static_framework = true
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: qonversion_flutter
description: Flutter plugin to implement in-app subscriptions and purchases. Validate user receipts and manage cross-platform access to paid content on your app. Android & iOS.
version: 4.6.0
version: 4.6.1
homepage: 'https://qonversion.io'
repository: 'https://github.com/qonversion/flutter-sdk'

Expand Down

0 comments on commit 49cc326

Please sign in to comment.