blob: e52fac60d8227251ca15078c386118370b1354b3 (
plain)
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: Package the app with krankerl
on:
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]
env:
KRANKERL_VERSION: 0.13.3
APP_NAME: twofactor_gateway
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Checkout App
uses: actions/checkout@v3
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Get cache directories
id: cache-dir
run: |
echo "::set-output name=composer::$(composer config cache-files-dir)"
echo "::set-output name=npm::$(npm config get cache)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.cache-dir.outputs.composer }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ${{ steps.cache-dir.outputs.npm }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install krankerl
run: |
wget https://github.com/ChristophWurst/krankerl/releases/download/v${KRANKERL_VERSION}/krankerl
sudo mv krankerl /usr/bin/krankerl
sudo chown root:root /usr/bin/krankerl
sudo chmod 755 /usr/bin/krankerl
- name: Package app
run: krankerl package
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}.tar.gz
path: build/artifacts/${{ env.APP_NAME }}.tar.gz
- name: Attach artifact to release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_PATH: build/artifacts/${{ env.APP_NAME }}.tar.gz
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|