Repository navigation
One-step setup for Windows, Linux and macOS (setup.ps1, setup.sh) #80
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
+1,380
−36
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e8f87c8
One-step setup for Windows, Linux and macOS (setup.ps1, setup.sh)
ersinkoc e277f80
setup.ps1: warn when Smart App Control is on (from #78's guide)
ersinkoc de9763c
setup.ps1: exit code 0 after a successful run
ersinkoc 402931f
setup.ps1: replace the files in place instead of renaming the folder
ersinkoc 381ac86
setup: review fixes
ersinkoc 88615de
setup.sh: keep the XDG folders in the systemd unit; no $$ in its path
ersinkoc cafb3b2
setup.sh: remove an older login service when the new path cannot get one
ersinkoc 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: setup | ||
|
|
||
| # Runs the one-step installers (setup.ps1, setup.sh) for real against the published release: | ||
| # download, checksum, dependencies, install, start, and a second run that updates a running agent. | ||
| on: | ||
| pull_request: | ||
| paths: [setup.ps1, setup.sh, .github/workflows/setup.yml] | ||
| push: | ||
| branches: [main] | ||
| paths: [setup.ps1, setup.sh, .github/workflows/setup.yml] | ||
| schedule: | ||
| - cron: '17 6 * * 1' # weekly: the latest release against current winget, Homebrew and distribution packages | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false # the jobs run downloaded programs and need no Git access | ||
| - name: shellcheck | ||
| run: | | ||
| bash -n setup.sh | ||
| shellcheck setup.sh | ||
| - name: PSScriptAnalyzer | ||
| shell: pwsh | ||
| run: | | ||
| Install-Module PSScriptAnalyzer -Scope CurrentUser -Force | ||
| $issues = Invoke-ScriptAnalyzer -Path setup.ps1 -Severity Error, ParseError | ||
| $issues | Format-Table -AutoSize | Out-String -Width 200 | ||
| if ($issues) { throw "PSScriptAnalyzer: $($issues.Count) error(s)" } | ||
|
|
||
| windows: | ||
| name: setup.ps1 (Windows PowerShell 5.1) | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false # the jobs run downloaded programs and need no Git access | ||
| - name: First install | ||
| shell: powershell | ||
| run: '& ([scriptblock]::Create((Get-Content -Raw .\setup.ps1))) -Yes -NoPhone -AllowAdministrator' | ||
| - name: Check the running agent | ||
| shell: powershell | ||
| run: | | ||
| $info = Invoke-RestMethod http://127.0.0.1:8765/api/info | ||
| "version $($info.version), adb $($info.adb)" | ||
| if (-not $info.adb) { throw 'setup did not install adb' } | ||
| if (-not (Test-Path "$env:LOCALAPPDATA\PhoneBox\app\PhoneBoxAgent.exe")) { throw 'agent not in the install folder' } | ||
| if (-not (Test-Path ([Environment]::GetFolderPath('Startup') + '\PhoneBox.lnk'))) { throw 'no Startup shortcut' } | ||
| - name: Second run replaces a running agent | ||
| shell: powershell | ||
| run: | | ||
| & ([scriptblock]::Create((Get-Content -Raw .\setup.ps1))) -Yes -NoPhone -AllowAdministrator | ||
| Invoke-RestMethod http://127.0.0.1:8765/api/info | Select-Object version, os | ||
| - name: Stop the agent | ||
| if: always() | ||
| shell: powershell | ||
| run: Get-Process PhoneBoxAgent -ErrorAction SilentlyContinue | Stop-Process -Force | ||
|
|
||
| unix: | ||
| name: setup.sh (${{ matrix.os }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] | ||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| HOMEBREW_NO_AUTO_UPDATE: '1' | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false # the jobs run downloaded programs and need no Git access | ||
| - name: First install (piped, as with curl | bash) | ||
| run: cat setup.sh | bash -s -- --yes --no-phone | ||
| - name: Check the running agent | ||
| run: | | ||
| curl -fsS http://127.0.0.1:8765/api/info | tee /tmp/info.json; echo | ||
| python3 -c 'import json; i = json.load(open("/tmp/info.json")); assert i["adb"], "setup did not install adb"' | ||
| - name: Second run replaces a running agent | ||
| run: | | ||
| bash setup.sh --yes --no-phone --no-extras | ||
| curl -fsS http://127.0.0.1:8765/api/info >/dev/null | ||
| - name: Stop the agent | ||
| if: always() | ||
| run: | | ||
| launchctl unload "$HOME/Library/LaunchAgents/net.oxog.phonebox.agent.plist" 2>/dev/null || true | ||
| systemctl --user stop phonebox.service 2>/dev/null || true | ||
| pkill -x PhoneBoxAgent || true | ||
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
Oops, something went wrong.
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.