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
37 changes: 14 additions & 23 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@ permissions:
jobs:
bump-version:
name: Bump version
runs-on: macos-26
timeout-minutes: 15
runs-on: ubuntu-latest
timeout-minutes: 10

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
Expand All @@ -39,39 +35,34 @@ jobs:
- 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"
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
- name: Create branch, commit, and push
run: |
BRANCH_NAME="chore/bump-version-${{ inputs.version }}"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -B "$BRANCH_NAME"
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
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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" \
--title "chore: bump version to ${{ inputs.version }}" \
--body "Bumps the app version to ${{ inputs.version }}." \
--base main \
--head "$PR_BRANCH" \
--draft
Loading