Skip to content

Add phar build

Add phar build #7

Workflow file for this run

name: PHAR
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
jobs:
build-agent:
name: Build Agent
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref }}
- name: Setup PHP for agent dependencies
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401
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@9e72090525849c5e82e596468b86eb55e9cc5401
with:
php-version: '8.2'
tools: box
ini-values: phar.readonly=0
- name: Build PHAR
run: scripts/build.sh
- name: Setup PHP for PHAR test
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401
with:
php-version: '7.2'
- name: Test PHAR
run: php bin/sentry-agent help
- name: Upload PHAR artifacts
uses: actions/upload-artifact@v4
with:
name: sentry-agent-${{ github.sha }}
path: |
bin/sentry-agent
- name: Commit PHAR on main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: EndBug/add-and-commit@v9
with:
add: "bin/sentry-agent"
message: "Add PHAR artifact [skip ci]"
default_author: github_actions
push: true
branch: main