-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.28 KB
/
actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Test and Publish
on:
push:
branches:
- release
- release-candidate
pull_request:
branches:
- release
- release-candidate
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0' # You can specify the PHP version you need
- name: Install Composer
run: |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
- name: Install dependencies
run: composer install
- name: Regenerate autoload files
run: composer dump-autoload
- name: Run tests
run: ./vendor/bin/phpunit --configuration phpunit.xml
publish:
runs-on: ubuntu-latest
needs: tests
if: github.ref == 'refs/heads/release'
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release