Check Packagist

This commit is contained in:
2025-07-20 15:24:05 -04:00
parent ab4874f6c3
commit c28d85d526
2 changed files with 42 additions and 1 deletions

35
.github/workflows/publish-package.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Publish Package
on:
release:
types: [created]
jobs:
publish-github:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Validate composer.json
run: composer validate
- name: Configure GitHub Packages
run: |
composer config repositories.github '{"type": "vcs", "url": "https://github.com/sqrtspace/spacetime-php"}'
composer config --global --auth github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
- name: Publish to GitHub Packages
run: |
sed -i 's/"name": "sqrtspace\/spacetime"/"name": "sqrtspace\/spacetime-php"/' composer.json
composer config repositories.github '{"type": "composer", "url": "https://nuget.pkg.github.com/sqrtspace/index.json"}'
echo "{\"github-oauth\": {\"github.com\": \"${{ secrets.GITHUB_TOKEN }}\"}}" > auth.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -85,5 +85,11 @@
} }
}, },
"minimum-stability": "stable", "minimum-stability": "stable",
"prefer-stable": true "prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://nuget.pkg.github.com/sqrtspace/index.json"
}
]
} }