Skip to content

Commit 498a572

Browse files
authored
Merge pull request #567 from nimblehq/feature/557-automate-release-pull-request-creation-process
[#557] Automate Release Pull Request Creation Process
2 parents cdef603 + 34f498b commit 498a572

File tree

3 files changed

+121
-2
lines changed

3 files changed

+121
-2
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## ✨ Features",
5+
"labels": [
6+
"type : feature"
7+
],
8+
"empty_content": "N/A"
9+
},
10+
{
11+
"title": "## 🐛 Bug fixes",
12+
"labels": [
13+
"type : bug"
14+
],
15+
"empty_content": "N/A"
16+
},
17+
{
18+
"title": "## 🧹 Chores",
19+
"labels": [
20+
"type : chore"
21+
],
22+
"empty_content": "N/A"
23+
},
24+
{
25+
"title": "## Others",
26+
"exclude_labels": [
27+
"type : feature",
28+
"type : bug",
29+
"type : chore",
30+
"type : release"
31+
]
32+
}
33+
],
34+
"max_pull_requests": 200
35+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Create the Release pull request and Bump the next version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
nextVersion:
7+
description: "Next version (eg. 1.0.0)"
8+
required: true
9+
type: string
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
create_release_pull_request:
17+
name: Create Release Pull Request
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Get release version
25+
run: |
26+
filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1)
27+
release_version=$(sed -n 's/.*MARKETING_VERSION *= *\([^;]*\);.*/\1/p' "$filename.xcodeproj/project.pbxproj" | head -n 1 | sed 's/^[^=]*=\s*//' | tr -d ' ')
28+
echo $release_version
29+
echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV"
30+
31+
- uses: nimblehq/github-actions-workflows/[email protected]
32+
with:
33+
release_version: ${{ env.RELEASE_VERSION }}
34+
changelog_configuration: ".github/workflows/configs/changelog-config.json"
35+
assignee: bot-nimble
36+
37+
create_bump_version_pull_request:
38+
name: Bump Version Pull Request
39+
runs-on: macos-latest
40+
timeout-minutes: 30
41+
permissions:
42+
contents: write
43+
pull-requests: write
44+
steps:
45+
- name: Validate Version Input
46+
run: |
47+
if ! [[ "${{ github.event.inputs.nextVersion }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
48+
echo "Error: nextVersion must follow semantic versioning (e.g., 1.2.3)"
49+
exit 1
50+
fi
51+
- name: Create Bump Version branch
52+
uses: peterjgrainger/[email protected]
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
branch: chore/bump-version-to-${{ github.event.inputs.nextVersion }}
57+
58+
- name: Checkout code
59+
uses: actions/checkout@v4
60+
with:
61+
ref: chore/bump-version-to-${{ github.event.inputs.nextVersion }}
62+
63+
- name: Bump version
64+
run: |
65+
filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1)
66+
sed -i "" "s/MARKETING_VERSION = .*/MARKETING_VERSION = ${{ github.event.inputs.nextVersion }};/g" $filename.xcodeproj/project.pbxproj
67+
68+
- name: Set up Git
69+
run: |
70+
git config --global user.name 'Github Actions'
71+
git config --global user.email '[email protected]'
72+
73+
- name: Commit changes
74+
run: |
75+
git add .
76+
git commit -m "[Chore] Bump version to ${{ github.event.inputs.nextVersion }}"
77+
git push origin HEAD
78+
79+
- name: Create pull request
80+
run: |
81+
echo -e "## What happened 👀\n\nBump version to ${{ github.event.inputs.nextVersion }}" > body
82+
export body=$(cat body) ; gh pr create --draft -B develop -H chore/bump-version-to-${{ github.event.inputs.nextVersion }} -t '[Chore] Bump version to ${{ github.event.inputs.nextVersion }}' -b "$body"
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Scripts/Swift/iOSTemplateMaker/Sources/iOSTemplateMaker/SetUpiOSProject.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class SetUpIOSProject {
9090
}
9191

9292
if isCI {
93-
minimumVersion = "14.0"
93+
minimumVersion = "15.0"
9494
}
9595

9696
if bundleIdProduction.isEmpty {
@@ -123,7 +123,7 @@ class SetUpIOSProject {
123123
if minimumVersion.isEmpty {
124124
tryMoveDown()
125125

126-
let defaultVersion = "14.0"
126+
let defaultVersion = "16.0"
127127
minimumVersion = ask(
128128
"Which is the iOS minimum version?",
129129
note: "Default: \(defaultVersion)",

0 commit comments

Comments
 (0)