diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index b6bcc7f..8c52690 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -15,8 +15,8 @@ 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 @@ -24,10 +24,6 @@ jobs: 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 @@ -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