Skip to content

Commit 460e392

Browse files
authored
Merge pull request #44 from Codeception/automated-releases
chore(ci): set up automated releases
2 parents ff2ecb3 + 791f89b commit 460e392

File tree

3 files changed

+79
-3
lines changed

3 files changed

+79
-3
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: CI
22

33
on:
44
pull_request:
5-
push:
6-
branches:
7-
- master
85
jobs:
96
tests:
107
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Automated release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
php: [ 8.1, 8.2, 8.3, 8.4 ]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
coverage: none
23+
24+
- name: Validate composer.json and composer.lock
25+
run: composer validate
26+
27+
- name: Install dependencies
28+
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
29+
30+
- name: Execute Code Sniffer
31+
run: vendor/bin/phpcs
32+
33+
- name: Execute PHP Stan
34+
run: vendor/bin/phpstan
35+
36+
- name: Run test suite
37+
run: |
38+
php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 &
39+
php -S 127.0.0.1:8010 -t tests/data/rest >/dev/null 2>&1 &
40+
php vendor/bin/codecept run
41+
42+
43+
release:
44+
name: Automated release
45+
needs:
46+
- tests
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
persist-credentials: false
53+
- uses: actions/setup-node@v4
54+
with:
55+
node-version: 22
56+
- run: >
57+
npx
58+
-p "@semantic-release/commit-analyzer"
59+
-p "@semantic-release/release-notes-generator"
60+
-p conventional-changelog-conventionalcommits
61+
-p semantic-release
62+
-- semantic-release
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
permissions:
66+
packages: write
67+
contents: write
68+
pull-requests: write

.releaserc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"branches": ["master"],
3+
"tagFormat": "${version}",
4+
"plugins": [
5+
["@semantic-release/commit-analyzer", {
6+
"preset": "conventionalcommits",
7+
"presetConfig": {}
8+
}],
9+
"@semantic-release/github",
10+
"@semantic-release/release-notes-generator"]
11+
}

0 commit comments

Comments
 (0)