-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Release automation Releases automation. Fix Fix Change in yml Small change Test 1 Test 2 Rename * Fix
- Loading branch information
1 parent
6e3bcce
commit 860091b
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |