Repository navigation
55 lines (43 loc) · 1.56 KB
/
Copy pathrelease.yml
File metadata and controls
55 lines (43 loc) · 1.56 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
name: Build and Release PHAR
on:
release:
types: [published]
jobs:
build-and-upload:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history so we can push back to the branch
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install NPM dependencies
run: npm ci
- name: Build assets
run: npm run build
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, phar, iconv
tools: composer
- name: Install Dependencies
run: composer install --no-dev --optimize-autoloader --no-interaction
- name: Inject Version and Build
run: |
VERSION=${{ github.event.release.tag_name }}
# 1. Update the version in the source code
sed -i "s/%%VERSION%%/$VERSION/g" src/bootstrap.php
# 2. Build the PHAR
php -d phar.readonly=0 build-phar.php
- name: Upload PHAR to Release
uses: softprops/action-gh-release@v2
with:
files: phpmemcachedadmin.phar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}