-
Notifications
You must be signed in to change notification settings - Fork 7
93 lines (86 loc) · 2.63 KB
/
step_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
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
91
92
93
name: Step Review
on:
workflow_call:
secrets:
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
PACKAGIST_USER:
required: true
PACKAGIST_TOKEN:
required: true
inputs:
VERSION:
description: "PHPUnuhi Version"
required: true
type: string
PHP_VERSION:
description: "PHP Version"
required: true
type: string
jobs:
build:
name: Build Artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# -----------------------------------
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.PHP_VERSION }}
ini-values: phar.readonly=OFF
# -----------------------------------
- name: Mount Cache
uses: actions/cache@v4
with:
key: cache-build-${{ github.run_id }}
path: |
build
vendor
# -----------------------------------
- name: Build Artifacts
run: |
make prod
make build -B
make artifact
docker:
name: Build Docker Image
runs-on: ubuntu-latest
needs: [ build ]
steps:
- uses: actions/checkout@v4
# -----------------------------------
- name: Mount Cache
uses: actions/cache@v4
with:
key: cache-build-${{ github.run_id }}
path: |
build
vendor
# -----------------------------------
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# -----------------------------------
- name: Build Docker Image
run: make pack version=${{ inputs.VERSION }}
# -----------------------------------
- name: Push Docker Image
run: |
docker push boxblinkracer/phpunuhi:${{ inputs.VERSION }}
# ------------------------------------------------------------------------------------------------------------------------
packagist:
name: Update Packagist
runs-on: ubuntu-latest
needs: [ build ]
steps:
# -----------------------------------
- uses: actions/checkout@v4
# -----------------------------------
- name: Invoke Packagist Webhook
run: |
curl -XPOST -H'content-type:application/json' 'https://packagist.org/api/update-package?username=${{ secrets.PACKAGIST_USER }}&apiToken=${{ secrets.PACKAGIST_TOKEN }}' -d'{"repository":{"url":"https://packagist.org/packages/boxblinkracer/phpunuhi"}}'