-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 2.99 KB
/
Copy pathphp-release.yml
File metadata and controls
90 lines (78 loc) · 2.99 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
name: Aether Vault PHP Release
on:
push:
tags:
- "v*.*.*-php"
jobs:
build:
name: Build & Test PHP SDK
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Validate composer.json
working-directory: ./package/php
run: composer validate --strict
- name: Cache Composer dependencies
uses: actions/cache@v6
with:
path: package/php/vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/package/php/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
working-directory: ./package/php
run: composer install --prefer-dist --no-progress --no-interaction
- name: Run tests
working-directory: ./package/php
run: composer test
continue-on-error: true
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Generate Release Notes
id: release_notes
working-directory: ./package/php
run: |
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "# Aether Vault PHP SDK ${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "## 📦 Package Information" >> $GITHUB_OUTPUT
echo "- **Package**: \`aether-vault/php-sdk\`" >> $GITHUB_OUTPUT
echo "- **Version**: ${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
echo "- **PHP**: >= 8.1" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "## 🚀 Installation" >> $GITHUB_OUTPUT
echo '```bash' >> $GITHUB_OUTPUT
echo 'composer config repositories.aether-vault composer https://github.com/${{ github.repository_owner }}' >> $GITHUB_OUTPUT
echo 'composer require aether-vault/php-sdk' >> $GITHUB_OUTPUT
echo '```' >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "## 📚 Documentation" >> $GITHUB_OUTPUT
echo "- [README](https://github.com/${{ github.repository }}/blob/main/package/php/README.md)" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "**Note**: Automated release from tag." >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref_name }}
name: Aether Vault PHP SDK ${{ github.ref_name }}
body: ${{ steps.release_notes.outputs.notes }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}