-
Notifications
You must be signed in to change notification settings - Fork 83
58 lines (56 loc) · 1.79 KB
/
release.yml
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
name: Release
on:
workflow_dispatch:
release:
types: [created]
jobs:
upload:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v3
with:
path: ./vendor
key: ${{ runner.os }}-composer-${{ hashFiles('./composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: zip, imagick, gd
- name: Install npm
run: npm i
- name: Install composer
run: composer install --no-progress --no-suggest
- name: Run build
run: npm run build
- name: Install composer optimized
run: composer install --no-dev --no-progress --no-suggest --optimize-autoloader
- name: Create archive
run: zip -r flynt-${{ github.event.release.tag_name || 'bundled' }}.zip ./ -x './node_modules/*' './**/.git/*'
- name: Create download
if: ${{ github.event.release.upload_url }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./flynt-${{ github.event.release.tag_name }}.zip
asset_name: flynt-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip
- name: Create download
if: ${{ !github.event.release.upload_url }}
uses: actions/upload-artifact@v3
with:
name: flynt-bundled
path: ./flynt-bundled.zip