-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add phar build #21
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
Add phar build #21
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
34cffdf
wip
cleptric ea0d385
Move code to subfolder to allow package without dependencies
stayallive 21a3fc9
test CI build
Litarnus 6f334f6
use php72 compatible phpstan
Litarnus 12ed03b
update agent dir
Litarnus 05b5dae
wip
Litarnus 7d1cae0
wip
Litarnus 0112421
commit phar on merge to main
Litarnus c4748d6
craft & release workflow
Litarnus 3420e9c
Update .craft.yml
Litarnus c58e6a2
fix index
Litarnus 2887222
Update .github/workflows/ci.yaml
Litarnus aa2b02c
Update .github/workflows/ci.yaml
Litarnus 23fd4b2
Update .github/workflows/ci.yaml
Litarnus be46d61
Update .github/workflows/phpstan.yaml
Litarnus 0ad705b
Update .github/workflows/phpstan.yaml
Litarnus e82b047
Update agent/composer.json
Litarnus ac25830
updates
Litarnus 2e007a5
Merge remote-tracking branch 'origin/phar-build' into phar-build
Litarnus 5215d73
wip
cleptric 30e8b3f
Add PHAR artifact [skip ci]
github-actions[bot] df73393
wip
cleptric 538f37b
Add PHAR artifact
github-actions[bot] 4c823df
wip
Litarnus 5f17c5e
Add PHAR artifact
github-actions[bot] b0c3903
wip
Litarnus 9a53e34
Merge remote-tracking branch 'origin/phar-build' into phar-build
Litarnus 0ec28db
Add PHAR artifact
github-actions[bot] ecbec55
wip
Litarnus cc1dde6
wip
Litarnus 8c26aea
Add PHAR artifact
github-actions[bot] b868d26
Add PHAR artifact
github-actions[bot] c7cde45
Add PHAR artifact
github-actions[bot] dae94cd
wip
Litarnus cd4963d
Merge remote-tracking branch 'origin/phar-build' into phar-build
Litarnus 48a7d60
Add PHAR artifact
github-actions[bot] 59a368a
wip
Litarnus 8f6b7a8
wip
Litarnus e1e1519
wip
Litarnus 2e5dcae
wip
Litarnus 1bd535e
Add PHAR artifact
github-actions[bot] 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,9 @@ | ||
| minVersion: 0.23.1 | ||
| changelogPolicy: simple | ||
| artifactProvider: | ||
| name: none | ||
| targets: | ||
| - name: github | ||
| - name: registry | ||
| sdks: | ||
| composer:sentry/sentry-agent: |
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,65 @@ | ||
| name: Build PHAR | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-agent: | ||
| name: Build Agent | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Internal github app token | ||
| uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 | ||
| id: app-token | ||
| with: | ||
| app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | ||
| private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| fetch-depth: 0 | ||
| ref: ${{ github.head_ref || github.ref }} | ||
|
|
||
| - name: Setup PHP for agent dependencies | ||
| uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4 | ||
| with: | ||
| php-version: '7.2' | ||
| tools: composer:v2 | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: agent | ||
| run: composer update --no-progress --no-interaction --prefer-dist | ||
|
|
||
| - name: Setup PHP for Box | ||
| uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4 | ||
| with: | ||
| php-version: '8.4' | ||
| tools: box | ||
| ini-values: phar.readonly=0 | ||
|
|
||
| - name: Build PHAR | ||
| run: scripts/build.sh | ||
| env: | ||
| COMPOSER_ROOT_VERSION: 0.1.0 # For reproducible PHAR builds | ||
|
|
||
| - name: Setup PHP for PHAR test | ||
| uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4 | ||
| with: | ||
| php-version: '7.2' | ||
|
|
||
| - name: Test PHAR | ||
| run: php bin/sentry-agent help | ||
|
|
||
| - name: Commit PHAR | ||
| uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 | ||
| with: | ||
| add: "bin/sentry-agent bin/sentry-agent.sig" | ||
| message: "Add PHAR artifact" | ||
| default_author: github_actions | ||
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,45 @@ | ||
| name: Prepare Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Version to release | ||
| required: true | ||
| force: | ||
| description: Force a release even when there are release-blockers (optional) | ||
| required: false | ||
| merge_target: | ||
| description: Target branch to merge into. Uses the default branch as a fallback (optional) | ||
| required: false | ||
| default: main | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| name: Release version | ||
| steps: | ||
| - name: Get auth token | ||
| id: token | ||
| uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 | ||
| with: | ||
| app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | ||
| private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| token: ${{ steps.token.outputs.token }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Prepare release | ||
| uses: getsentry/action-prepare-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.token.outputs.token }} | ||
| with: | ||
| version: ${{ github.event.inputs.version }} | ||
| force: ${{ github.event.inputs.force }} | ||
| merge_target: ${{ github.event.inputs.merge_target }} |
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 |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| *.lock | ||
| !agent/composer.lock | ||
| package.xml | ||
| /vendor | ||
| vendor | ||
| .idea | ||
| .php-cs-fixer.cache | ||
| .phpbench | ||
|
|
||
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,6 @@ | ||
| { | ||
| "main": "src/sentry-agent.php", | ||
| "output": "../bin/sentry-agent", | ||
| "alias": "sentry-agent.phar", | ||
| "timestamp": "20250904" | ||
| } |
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,48 @@ | ||
| { | ||
| "name": "sentry/sentry-agent-internal", | ||
| "type": "library", | ||
| "description": "Sentry Agent for PHP (https://sentry.io)", | ||
| "homepage": "https://sentry.io", | ||
| "license": "MIT", | ||
| "authors": [ | ||
| { | ||
| "name": "Sentry", | ||
| "email": "accounts@sentry.io" | ||
| } | ||
| ], | ||
| "require": { | ||
| "php": "^7.2|^8.0", | ||
| "ext-json": "*", | ||
| "clue/mq-react": "^1.6", | ||
| "react/http": "^1.11", | ||
| "react/socket": "^1.16", | ||
| "sentry/sentry": "^4.15.0" | ||
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "Sentry\\Agent\\": "src/" | ||
| } | ||
| }, | ||
| "require-dev": { | ||
| "phpstan/phpstan": "1.12.5", | ||
| "phpunit/phpunit": "^8.5|^9.6" | ||
| }, | ||
| "autoload-dev": { | ||
| "psr-4": { | ||
| "Sentry\\Agent\\Tests\\": "tests/" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "check": [ | ||
| "@phpstan", | ||
| "@tests" | ||
| ], | ||
| "tests": "vendor/bin/phpunit --verbose", | ||
| "phpstan": "vendor/bin/phpstan analyse" | ||
| }, | ||
| "config": { | ||
| "sort-packages": true, | ||
| "autoloader-suffix": "SentryAgentChecksum" | ||
| }, | ||
| "prefer-stable": true | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit weird as we probably want it as constant as possible but the naming implies it should be dynamic