Skip to content

Commit 96f11df

Browse files
committed
chore: add Packagist publish workflow
1 parent 9a1146e commit 96f11df

3 files changed

Lines changed: 96 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Version tag to publish (for example v1.1.0)'
11+
required: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
publish:
18+
name: package and publish to Packagist
19+
runs-on: ubuntu-latest
20+
environment: packagist
21+
env:
22+
PACKAGE_NAME: arcp/arcp
23+
REPOSITORY_URL: https://github.com/agentruntimecontrolprotocol/php-sdk
24+
PACKAGIST_USERNAME: ${{ secrets.PACKAGIST_USERNAME }}
25+
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v6
29+
with:
30+
ref: ${{ inputs.tag || github.ref }}
31+
fetch-depth: 0
32+
33+
- name: Setup PHP
34+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
35+
with:
36+
php-version: '8.4'
37+
extensions: pdo, pdo_sqlite, mbstring, json
38+
tools: composer:v2
39+
40+
- name: Validate composer metadata
41+
run: composer validate --strict
42+
43+
- name: Install production dependencies
44+
run: composer install --no-dev --no-progress --no-interaction --prefer-dist
45+
46+
- name: Build Composer archive
47+
run: |
48+
set -euo pipefail
49+
mkdir -p build
50+
version="${GITHUB_REF_NAME}"
51+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
52+
version="${{ inputs.tag }}"
53+
fi
54+
composer archive --format=zip --file="build/${PACKAGE_NAME//\//-}-${version}"
55+
56+
- name: Upload package artifact
57+
uses: actions/upload-artifact@v7
58+
with:
59+
name: composer-package
60+
path: build/*.zip
61+
if-no-files-found: error
62+
63+
- name: Publish to Packagist
64+
run: |
65+
set -euo pipefail
66+
67+
if [ -z "${PACKAGIST_USERNAME}" ] || [ -z "${PACKAGIST_TOKEN}" ]; then
68+
echo "PACKAGIST_USERNAME and PACKAGIST_TOKEN repository secrets are required." >&2
69+
exit 1
70+
fi
71+
72+
status="$(curl -sS -o /tmp/packagist-package.json -w '%{http_code}' \
73+
"https://repo.packagist.org/p2/${PACKAGE_NAME}.json")"
74+
75+
if [ "${status}" = "200" ]; then
76+
endpoint="https://packagist.org/api/update-package"
77+
elif [ "${status}" = "404" ]; then
78+
endpoint="https://packagist.org/api/create-package"
79+
else
80+
echo "Unexpected Packagist metadata status ${status}" >&2
81+
cat /tmp/packagist-package.json >&2 || true
82+
exit 1
83+
fi
84+
85+
curl --fail-with-body -sS \
86+
-X POST \
87+
-H 'Content-Type: application/json' \
88+
-H "Authorization: Bearer ${PACKAGIST_USERNAME}:${PACKAGIST_TOKEN}" \
89+
"${endpoint}" \
90+
-d "{\"repository\":\"${REPOSITORY_URL}\"}"

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.1.0] - 2026-05-22
11+
1012
### Added
1113

1214
- ARCP v1.1 feature coverage for `session.list_jobs` / `session.jobs`,

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"type": "library",
55
"license": "Apache-2.0",
66
"keywords": ["arcp", "agent", "runtime", "protocol", "websocket", "stdio"],
7-
"homepage": "https://github.com/arcp/php-sdk",
7+
"homepage": "https://github.com/agentruntimecontrolprotocol/php-sdk",
88
"authors": [
99
{"name": "ARCP Contributors"}
1010
],
1111
"support": {
12-
"issues": "https://github.com/arcp/php-sdk/issues",
13-
"source": "https://github.com/arcp/php-sdk",
14-
"docs": "https://github.com/arcp/php-sdk/tree/main/docs"
12+
"issues": "https://github.com/agentruntimecontrolprotocol/php-sdk/issues",
13+
"source": "https://github.com/agentruntimecontrolprotocol/php-sdk",
14+
"docs": "https://github.com/agentruntimecontrolprotocol/php-sdk/tree/main/docs"
1515
},
1616
"require": {
1717
"php": ">=8.4",

0 commit comments

Comments
 (0)