-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update package on packagist when a new release is published
- Loading branch information
1 parent
6320977
commit 120f581
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,26 @@ | ||
name: publish | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
packagist: | ||
name: Publish Package to Packagist | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Trigger Packagist Update | ||
env: | ||
PACKAGIST_USERNAME: ${{ secrets.PACKAGIST_USERNAME }} | ||
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }} | ||
run: | | ||
curl -X POST https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_TOKEN} \ | ||
-H "Content-Type: application/json" \ | ||
-d "{\"repository\":{\"url\":\"${{ github.event.repository.clone_url }}\"}}" |