-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (63 loc) 路 1.98 KB
/
Copy pathrelease-php.yml
File metadata and controls
75 lines (63 loc) 路 1.98 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
74
75
name: Release PHP
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
type: string
permissions:
contents: write
jobs:
release-php:
name: Release PHP
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Cache Composer dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: 8.4
- name: Install dependencies
run: composer install
- name: Set release version
env:
INPUTS_VERSION: ${{ github.event.inputs.version }}
REF_NAME: ${{ github.ref_name }}
run: |
version="${INPUTS_VERSION:-${REF_NAME}}"
echo "RELEASE_VERSION=$version" >> "$GITHUB_ENV"
echo "Release version: $version"
# yamllint disable-line #;< PHP_PHAR
- name: Set PHAR version
run: |
sed -i "s/\"yourproject-version\": \"development\"/\"yourproject-version\": \"${RELEASE_VERSION}\"/g" box.json
- name: Build PHAR
run: composer build
- name: Test PHAR
run: |
./.build/php-command.phar --version
./.build/php-command.phar || exit 1
# yamllint disable-line #;> PHP_PHAR
- name: Create Release
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
with:
tag_name: ${{ env.RELEASE_VERSION }}
files: |
#;< PHP_PHAR
./.build/php-command.phar
#;> PHP_PHAR
#;< PHP_SCRIPT
php-script
#;> PHP_SCRIPT