-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#557] Automate Release Pull Request Creation Process #567
Open
markgravity
wants to merge
5
commits into
develop
Choose a base branch
from
feature/557-automate-release-pull-request-creation-process
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+188
−2
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
99d94b8
[#557] Add Create Release Pull Request workflow
markgravity 2eb6716
[#557] Add Create Release Pull Request workflow
markgravity 44efb98
[#557] Add validation step
markgravity 8bb37ad
[#557] Change create release PR approach
markgravity 4308292
test
markgravity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,32 @@ | ||
{ | ||
"categories": [ | ||
{ | ||
"title": "## ✨ Features", | ||
"labels": [ | ||
"type: feature" | ||
] | ||
}, | ||
{ | ||
"title": "## 🐛 Bug fixes", | ||
"labels": [ | ||
"type: bug" | ||
] | ||
}, | ||
{ | ||
"title": "## 🧹 Chores", | ||
"labels": [ | ||
"type: chore" | ||
] | ||
}, | ||
{ | ||
"title": "## Others", | ||
"exclude_labels": [ | ||
"type: feature", | ||
"type: bug", | ||
"type: chore", | ||
"type: release" | ||
] | ||
} | ||
], | ||
"max_pull_requests": 200 | ||
} |
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,84 @@ | ||
name: Create Release Pull Request | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
nextVersion: | ||
description: "Next version (eg. 1.0.0)" | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
create_release_pull_request: | ||
name: Create Release Pull Request | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get release version | ||
run: | | ||
filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1) | ||
release_version=$(sed -n 's/.*MARKETING_VERSION *= *\([^;]*\);.*/\1/p' "$filename.xcodeproj/project.pbxproj" | head -n 1 | sed 's/^[^=]*=\s*//' | tr -d ' ') | ||
echo $release_version | ||
echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV" | ||
|
||
- uses: nimblehq/github-actions-workflows/create_release_pull_request@0.1.10 | ||
with: | ||
release_version: ${{ env.RELEASE_VERSION }} | ||
changelog_configuration: ".github/workflows/config/changelog-config.json" | ||
assignee: bot-nimble | ||
|
||
create_bump_version_pull_request: | ||
name: Create Bump Version Pull Request | ||
runs-on: macos-latest | ||
timeout-minutes: 30 | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Validate Version Input | ||
run: | | ||
if ! [[ "${{ github.event.inputs.nextVersion }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Error: nextVersion must follow semantic versioning (e.g., 1.2.3)" | ||
exit 1 | ||
fi | ||
- name: Create Bump Version branch | ||
markgravity marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uses: peterjgrainger/action-create-branch@v2.2.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
branch: chore/bump-version-to-${{ github.event.inputs.nextVersion }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: chore/bump-version-to-${{ github.event.inputs.nextVersion }} | ||
|
||
- name: Bump version | ||
run: | | ||
filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1) | ||
sed -i "" "s/MARKETING_VERSION = .*/MARKETING_VERSION = ${{ github.event.inputs.nextVersion }};/g" $filename.xcodeproj/project.pbxproj | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.name 'Github Actions' | ||
git config --global user.email 'github-actions@users.noreply.github.com' | ||
|
||
- name: Commit changes | ||
run: | | ||
git add . | ||
git commit -m "[Chore] Bump version to ${{ github.event.inputs.nextVersion }}" | ||
git push origin HEAD | ||
|
||
- name: Create pull request | ||
run: | | ||
echo -e "## What happened 👀\n\nBump version to ${{ github.event.inputs.nextVersion }}" > body | ||
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" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,32 @@ | ||
{ | ||
"categories": [ | ||
{ | ||
"title": "## ✨ Features", | ||
"labels": [ | ||
"type: feature" | ||
] | ||
}, | ||
{ | ||
"title": "## 🐛 Bug fixes", | ||
"labels": [ | ||
"type: bug" | ||
] | ||
}, | ||
{ | ||
"title": "## 🧹 Chores", | ||
"labels": [ | ||
"type: chore" | ||
] | ||
}, | ||
{ | ||
"title": "## Others", | ||
"exclude_labels": [ | ||
"type: feature", | ||
"type: bug", | ||
"type: chore", | ||
"type: release" | ||
] | ||
} | ||
], | ||
"max_pull_requests": 200 | ||
} |
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,38 @@ | ||
name: Create Release Pull Request | ||
|
||
on: | ||
pull_request | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
create_release_pull_request: | ||
name: Create Release Pull Request | ||
runs-on: macOS-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Bundle install | ||
run: bundle install | ||
|
||
- name: Start Install Script for SwiftUI Template App | ||
run: swift run --package-path Scripts/Swift/iOSTemplateMaker iOSTemplateMaker make --bundle-id-production co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp --interface SwiftUI | ||
|
||
- name: Get release version | ||
run: | | ||
filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1) | ||
release_version=$(sed -n 's/.*MARKETING_VERSION *= *\([^;]*\);.*/\1/p' "$filename.xcodeproj/project.pbxproj" | head -n 1 | sed 's/^[^=]*=\s*//' | tr -d ' ') | ||
echo $release_version | ||
echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV" | ||
|
||
- uses: nimblehq/github-actions-workflows/create_release_pull_request@0.1.10 | ||
with: | ||
release_version: ${{ env.RELEASE_VERSION }} | ||
changelog_configuration: ".github/workflows/configs/changelog-config.json" | ||
assignee: bot-nimble |
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 |
---|---|---|
|
@@ -90,7 +90,7 @@ class SetUpIOSProject { | |
} | ||
|
||
if isCI { | ||
minimumVersion = "14.0" | ||
minimumVersion = "15.0" | ||
} | ||
|
||
if bundleIdProduction.isEmpty { | ||
|
@@ -123,7 +123,7 @@ class SetUpIOSProject { | |
if minimumVersion.isEmpty { | ||
tryMoveDown() | ||
|
||
let defaultVersion = "14.0" | ||
let defaultVersion = "15.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can go with 16.0; only 3% of the share market for the lower version than 16.0 |
||
minimumVersion = ask( | ||
"Which is the iOS minimum version?", | ||
note: "Default: \(defaultVersion)", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markgravity Why don't we leverage our prepared https://github.com/nimblehq/github-actions-workflows/tree/develop/create_release_pull_request workflow to create the release pull request for consistency & easy to maintain like us nimblehq/android-templates#562?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luongvo it seems this action requires a milestone to work, right? But we create this workflow to use on a client project, not for this template 🤔
Please correct me if I'm wrong 🙏