Skip to content

Commit 75dbb12

Browse files
committed
wokflow
1 parent 8276d22 commit 75dbb12

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to Packagist
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
test:
10+
name: Run PHP tests
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.1'
20+
coverage: none
21+
22+
- name: Install dependencies
23+
run: composer install --no-interaction --no-progress --prefer-dist
24+
25+
- name: Run tests
26+
run: composer test
27+
28+
publish:
29+
name: Notify Packagist
30+
needs: test
31+
runs-on: ubuntu-latest
32+
if: startsWith(github.ref, 'refs/tags/')
33+
steps:
34+
- name: Call Packagist API
35+
run: |
36+
curl -sS -X POST \
37+
-H "Content-Type: application/json" \
38+
-d "{\"repository\":{\"url\":\"https://github.com/2captcha/2captcha-php\"}}" \
39+
"https://packagist.org/api/update-package?username=${{ secrets.PACKAGIST_USERNAME }}&apiToken=${{ secrets.PACKAGIST_API_TOKEN }}"
40+

0 commit comments

Comments
 (0)