This repository was archived by the owner on Oct 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (111 loc) · 3.39 KB
/
release.yml
File metadata and controls
127 lines (111 loc) · 3.39 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Release
on:
push:
branches:
- main
paths-ignore:
- 'CHANGELOG.md'
- 'DEPENDENCIES.md'
- 'composer.json'
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.SEMANTIC_RELEASE_APP_ID }}
private_key: ${{ secrets.SEMANTIC_RELEASE_KEY_PEM }}
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Generate dependencies
run: |
chmod +x dependencies.sh
./dependencies.sh
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com/${{ github.repository }}.git
git add DEPENDENCIES.md
git commit -m "chore(release): auto-generate dependencies" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
code_coverage:
name: Code coverage
runs-on: ubuntu-latest
services:
mysql:
image: mysql/mysql-server:8.0
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: 'root'
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: 'testing'
MYSQL_USER: 'testing'
MYSQL_PASSWORD: 'testing'
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Run tests
run: vendor/bin/phpunit --coverage-clover clover.xml
env:
APP_KEY: ${{ secrets.TESTING_APP_KEY }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: clover.xml
flags: main
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release:
name: Release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Pull latest remote changes
run: git pull origin main
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.SEMANTIC_RELEASE_APP_ID }}
private_key: ${{ secrets.SEMANTIC_RELEASE_KEY_PEM }}
- name: Reset composer.json version
run: |
sed -i 's/\("version": "\)[0-9]\+\(\.[0-9]\+\)\{1,2\}"/\10.0.0"/' composer.json
- name: Release
uses: cycjimmy/semantic-release-action@v4
id: semantic-release
with:
semantic_version: 22.0.5
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}