Skip to content
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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/project_workflows/configs/changelog-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"categories": [
{
"title": "## ✨ Features",
"labels": [
"type : feature"
],
"empty_content": "N/A"
},
{
"title": "## 🐛 Bug fixes",
"labels": [
"type : bug"
],
"empty_content": "N/A"
},
{
"title": "## 🧹 Chores",
"labels": [
"type : chore"
],
"empty_content": "N/A"
},
{
"title": "## Others",
"exclude_labels": [
"type : feature",
"type : bug",
"type : chore",
"type : release"
]
}
],
"max_pull_requests": 200
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Create the Release pull request and Bump the next version

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/[email protected]
with:
release_version: ${{ env.RELEASE_VERSION }}
changelog_configuration: ".github/workflows/configs/changelog-config.json"
assignee: bot-nimble

create_bump_version_pull_request:
name: 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
uses: peterjgrainger/[email protected]
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 '[email protected]'

- 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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class SetUpIOSProject {
}

if isCI {
minimumVersion = "14.0"
minimumVersion = "15.0"
}

if bundleIdProduction.isEmpty {
Expand Down Expand Up @@ -123,7 +123,7 @@ class SetUpIOSProject {
if minimumVersion.isEmpty {
tryMoveDown()

let defaultVersion = "14.0"
let defaultVersion = "16.0"
minimumVersion = ask(
"Which is the iOS minimum version?",
note: "Default: \(defaultVersion)",
Expand Down