-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.72 KB
/
release.yml
File metadata and controls
54 lines (52 loc) · 1.72 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
name: Release
on:
workflow_dispatch:
release:
types: [created]
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js v12
uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/cache@v2
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v2
with:
path: ./vendor
key: ${{ runner.os }}-composer-${{ hashFiles('./composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install npm
run: npm i
- name: Install composer
run: php7.3 $(which composer) install --no-progress --no-suggest
- name: Run build
run: npm run build
- name: Install composer optimized
run: php7.3 $(which 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@v2
with:
name: flynt-bundled
path: ./flynt-bundled.zip