-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (59 loc) · 2.03 KB
/
release.yml
File metadata and controls
73 lines (59 loc) · 2.03 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intl, pdo_sqlite, sqlite3
tools: composer:v2
- name: Validate composer.json
run: composer validate --strict
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader
- name: Run tests
run: |
composer install --prefer-dist --no-progress --no-interaction
composer test
- name: Create release archive
run: |
# Remove development files
rm -rf tests/ phpunit.xml.dist .github/ .gitignore
# Create archive
RELEASE_NAME="yetisearch-${GITHUB_REF#refs/tags/}"
tar -czf "${RELEASE_NAME}.tar.gz" --exclude-vcs .
zip -r "${RELEASE_NAME}.zip" . -x "*.git*"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: YetiSearch ${{ github.ref }}
body: |
YetiSearch Library Release ${{ github.ref }}
## Installation
```bash
composer require yetisearch/yetisearch
```
## What's Changed
Please see [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details.
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yetisearch-${{ github.ref_name }}.tar.gz
asset_name: yetisearch-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip