Skip to content

Commit

Permalink
feat: update package on packagist when a new release is published
Browse files Browse the repository at this point in the history
  • Loading branch information
trivoallan authored Nov 2, 2024
1 parent 6320977 commit 120f581
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
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 }}\"}}"

0 comments on commit 120f581

Please sign in to comment.