-
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (57 loc) · 1.62 KB
/
semver.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Automatic Versioning and Release
on:
push:
branches:
- main
permissions:
contents: read
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Configure .env file
run: |
cp .env.example .env
mkdir -p var/logs
touch var/logs/app.log
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run tests
run: composer run-script test
# run this job only if the tests pass
release:
needs: tests
if: ${{ needs.tests.result == 'success' }}
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to create releases
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Format Code
run: composer run-script format
- name: Clean Dev Dependencies
run: |
rm -rf ./vendor
composer install --no-dev
- name: Release
id: semver
uses: huggingface/semver-release-action@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}