Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/phpPackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish PHP Package

on:
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g. 1.0.0)"
required: true
type: string

jobs:
test-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
tools: composer

- name: Install Dependencies
working-directory: php
run: composer install

- name: Run Tests
working-directory: php
run: ./vendor/bin/phpunit

- name: Tag Release
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git tag -a "php-v${{ github.event.inputs.version }}" -m "PHP Package v${{ github.event.inputs.version }}"
git push origin "php-v${{ github.event.inputs.version }}"

- name: Notify Packagist
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" -XPOST \
-H "content-type: application/json" \
"https://packagist.org/api/update-package?username=${{ secrets.PACKAGIST_USERNAME }}&apiToken=${{ secrets.PACKAGIST_TOKEN }}" \
-d "{\"repository\":{\"url\":\"https://github.com/${{ github.repository }}\"}}")
echo "Packagist API response: $STATUS"
if [[ "$STATUS" -lt 200 || "$STATUS" -ge 300 ]]; then
echo "Packagist notification failed with status $STATUS"
exit 1
fi
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
lib
lib
php/vendor/
php/.phpunit.result.cache
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
src
formatter.kt
formatter.kt
php
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"mustache": "^4.2.0"
},
"files": [
"*"
"*",
"!php"
],
"packageManager": "yarn@1.22.19+sha512.ff4579ab459bb25aa7c0ff75b62acebe576f6084b36aa842971cf250a5d8c6cd3bc9420b22ce63c7f93a0857bc6ef29291db39c3e7a23aab5adfd5a4dd6c5d71"
}
21 changes: 21 additions & 0 deletions php/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "vestaboard/vbml",
"description": "The Vestaboard Markup Language for PHP",
"type": "library",
"license": "GNU",
"authors": [{"name": "Vestaboard"}],
"require": {
"php": "^8.1",
"mustache/mustache": "^2.14"
},
"require-dev": {
"phpunit/phpunit": "^10.0"
},
"autoload": {
"psr-4": {"Vestaboard\\Vbml\\": "src/"}
},
"autoload-dev": {
"psr-4": {"Vestaboard\\Vbml\\Tests\\": "tests/"}
},
"minimum-stability": "stable"
}
Loading
Loading