Skip to content
Merged
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
77 changes: 77 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Bump version

on:
workflow_dispatch:
inputs:
version:
description: "New version string (e.g., 1.1.0)"
required: true
type: string

permissions:
contents: write
pull-requests: write

jobs:
bump-version:
name: Bump version
runs-on: macos-26
timeout-minutes: 15

steps:
- name: Checkout current repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set Xcode version
run: |
sudo xcode-select -s /Applications/Xcode_26.5.app

- name: Validate version input
run: |
if [ -z "${{ inputs.version }}" ]; then
echo "Error: version input is required"
exit 1
fi
echo "Bumping version to: ${{ inputs.version }}"

- name: Update MARKETING_VERSION in project.pbxproj
run: |
PROJECT_FILE="OpenAppLock.xcodeproj/project.pbxproj"

# Backup original
cp "$PROJECT_FILE" "$PROJECT_FILE.bak"

# Replace all MARKETING_VERSION entries
# Pattern: MARKETING_VERSION = 1.0; -> MARKETING_VERSION = {new_version};
sed -i '' 's/\(MARKETING_VERSION = \)[0-9.]*;/\1${{ inputs.version }};/' "$PROJECT_FILE"

# Verify changes were made
echo "Updated MARKETING_VERSION entries:"
grep "MARKETING_VERSION = " "$PROJECT_FILE" | head -5
echo "..."

- name: Commit changes
run: |
git add OpenAppLock.xcodeproj/project.pbxproj
git commit -m "chore: bump version to ${{ inputs.version }}"

- name: Push branch
run: |
BRANCH_NAME="chore/bump-version-${{ inputs.version }}"
git branch -m "chore/versioning-workflow" "$BRANCH_NAME"
git push origin "$BRANCH_NAME" --force

- name: Create pull request
run: |
PR_BRANCH="chore/bump-version-${{ inputs.version }}"
PR_TITLE="chore: bump version to ${{ inputs.version }}"
PR_BODY="Bumps the app version to ${{ inputs.version }}."

gh pr create \
--title "$PR_TITLE" \
--body "$PR_BODY" \
--base main \
--head "$PR_BRANCH" \
--draft
Loading