From 5af6fa5c8a903d16bf2fe33302a37bd9a03268fa Mon Sep 17 00:00:00 2001 From: Ege Darici Date: Thu, 17 Apr 2025 17:22:42 +0200 Subject: [PATCH] Create github action to trigger an update to packagist upon a new release of the package --- .github/workflows/update_packagist.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/update_packagist.yaml diff --git a/.github/workflows/update_packagist.yaml b/.github/workflows/update_packagist.yaml new file mode 100644 index 0000000..d1b12fa --- /dev/null +++ b/.github/workflows/update_packagist.yaml @@ -0,0 +1,18 @@ +name: Update Packagist + +on: + release: + types: [published] + +jobs: + update-packagist: + runs-on: ubuntu-latest + steps: + - name: Notify Packagist + env: + PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }} + run: | + curl -X POST -H + 'content-type:application/json' + 'https://packagist.org/api/update-package?username=Vesper&apiToken=${{ secrets.PACKAGIST_TOKEN }}' \ + -d '{"repository":{"url":"https://packagist.org/packages/vesper/unit-conversion"}}'