Skip to content

Commit

Permalink
Release automation (#92)
Browse files Browse the repository at this point in the history
* Release automation

Releases automation.

Fix

Fix

Change in yml

Small change

Test 1

Test 2

Rename

* Fix
  • Loading branch information
SpertsyanKM authored Aug 26, 2022
1 parent 6e3bcce commit 860091b
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/prerelease_github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Pre-release Github

on:
push:
branches:
- "main"

jobs:
pre-release:
runs-on: macos-latest

steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
LICENSE.txt
*.jar
50 changes: 50 additions & 0 deletions .github/workflows/release_pull_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release pull requests
on:
push:
tags:
- 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
28 changes: 28 additions & 0 deletions fastlane/fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
def update_package_json(new_version)
path = "../package.json"
regex = /"version": ".*",/
result_value = "\"version\": \"#{new_version}\","

update_file(path, regex, result_value)
end

def update_constant(new_version)
path = "../Runtime/Scripts/Qonversion.cs"
regex = /private const string SdkVersion = ".*";/
result_value = "private const string SdkVersion = \"#{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

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

update_package_json(new_version)
update_constant(new_version)
end

0 comments on commit 860091b

Please sign in to comment.