-
Notifications
You must be signed in to change notification settings - Fork 180
Address minor mobile deployment bugs #745
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9e2441a
feat: improve deployment tooling
transphorm 5a8347e
cr feedback
transphorm 3962ab6
for temp testing
transphorm 4f1f513
clean build artifacts after deploy
transphorm 76aa872
add deploy source
transphorm 0978527
uncomment ios commands
transphorm 3c1bdb9
Add tests for minor deployment fixes (#750)
transphorm 54cbfda
Merge branch 'codex/fix-mobile-deployment-logic-issues' of github.com…
transphorm 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,24 @@ | ||
| #!/bin/bash | ||
| # Reset Xcode project after local fastlane builds | ||
| set -euo pipefail | ||
|
|
||
| PROJECT_NAME="${IOS_PROJECT_NAME:-Self}" | ||
| PBXPROJ="ios/${PROJECT_NAME}.xcodeproj/project.pbxproj" | ||
|
|
||
| if [ ! -f "$PBXPROJ" ]; then | ||
| echo "Project file not found: $PBXPROJ" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| MARKETING_VERSION=$(grep -m1 "MARKETING_VERSION =" "$PBXPROJ" | awk '{print $3}' | tr -d ';') | ||
| CURRENT_VERSION=$(grep -m1 "CURRENT_PROJECT_VERSION =" "$PBXPROJ" | awk '{print $3}' | tr -d ';') | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| git checkout -- "$PBXPROJ" | ||
|
|
||
| if sed --version >/dev/null 2>&1; then | ||
| sed -i -e "s/\(MARKETING_VERSION = \).*/\1$MARKETING_VERSION;/" -e "s/\(CURRENT_PROJECT_VERSION = \).*/\1$CURRENT_VERSION;/" "$PBXPROJ" | ||
| else | ||
| sed -i '' -e "s/\(MARKETING_VERSION = \).*/\1$MARKETING_VERSION;/" -e "s/\(CURRENT_PROJECT_VERSION = \).*/\1$CURRENT_VERSION;/" "$PBXPROJ" | ||
| fi | ||
|
|
||
| echo "Reset $PBXPROJ" | ||
This file contains hidden or 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,43 @@ | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const os = require('os'); | ||
| const { execSync } = require('child_process'); | ||
| const { describe, it } = require('node:test'); | ||
| const assert = require('node:assert'); | ||
|
|
||
| const SCRIPT = path.join(__dirname, '../cleanup-ios-build.sh'); | ||
|
|
||
| describe('cleanup-ios-build.sh', () => { | ||
| it('resets pbxproj and reapplies versions', () => { | ||
| const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'cleanup-test-')); | ||
| const projectName = 'MyApp'; | ||
| const iosDir = path.join(tmp, 'ios', `${projectName}.xcodeproj`); | ||
| fs.mkdirSync(iosDir, { recursive: true }); | ||
| const pbxPath = path.join(iosDir, 'project.pbxproj'); | ||
| fs.writeFileSync( | ||
| pbxPath, | ||
| 'CURRENT_PROJECT_VERSION = 1;\nMARKETING_VERSION = 1.0.0;\n', | ||
| ); | ||
|
|
||
| const cwd = process.cwd(); | ||
| process.chdir(tmp); | ||
| execSync('git init -q'); | ||
| execSync('git config user.email "[email protected]"'); | ||
| execSync('git config user.name "Test"'); | ||
| execSync(`git add ${pbxPath}`); | ||
| execSync('git commit -m init -q'); | ||
|
|
||
| fs.writeFileSync( | ||
| pbxPath, | ||
| 'CURRENT_PROJECT_VERSION = 2;\nMARKETING_VERSION = 2.0.0;\nSomeArtifact = 123;\n', | ||
| ); | ||
|
|
||
| execSync(`IOS_PROJECT_NAME=${projectName} bash ${SCRIPT}`); | ||
| process.chdir(cwd); | ||
|
|
||
| const result = fs.readFileSync(pbxPath, 'utf8'); | ||
| assert(result.includes('CURRENT_PROJECT_VERSION = 2;')); | ||
| assert(result.includes('MARKETING_VERSION = 2.0.0;')); | ||
| assert(!result.includes('SomeArtifact')); | ||
| }); | ||
| }); |
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.
Uh oh!
There was an error while loading. Please reload this page.