-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (57 loc) · 1.8 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (57 loc) · 1.8 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
name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
verify:
name: Verify Release
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: '8.2'
coverage: xdebug
ini-values: display_errors=On, display_startup_errors=On, error_reporting=-1, zend.assertions=1, assert.exception=1
- name: Setup global variables
id: globals
shell: bash
run: |
echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
with:
path: ${{ steps.globals.outputs.COMPOSER_CACHE_DIR }}
key: composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-
- name: Install dependencies
run: composer update --ansi
- name: Run tests
run: composer test:unit
- name: Run static analysis
run: composer phpstan:check
release:
name: Create Release
runs-on: ubuntu-24.04
needs: verify
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Create release
env:
GH_TOKEN: ${{ secrets.RELEASE_ACTIONS_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" \
--title "${{ github.ref_name }}" \
--draft \
--generate-notes