-
Notifications
You must be signed in to change notification settings - Fork 39
108 lines (89 loc) · 2.75 KB
/
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Release
on:
push:
branches:
- master
jobs:
build-and-release-plugin:
name: Release artifact
runs-on: ubuntu-20.04
strategy:
matrix:
image:
- ubuntu-20.04
php:
- 8.2
steps:
- uses: actions/checkout@v3
- name: Pull pmmp/DevTools
uses: actions/checkout@v3
with:
repository: pmmp/DevTools
ref: stable
path: DevTools
- name: Check Texter version
id: check-texter-version
run: |
TEXTER_VERSION=`grep version plugin.yml | sed -e 's/^version: //g'`
echo "::set-output name=VER::${TEXTER_VERSION}"
- name: Check short SHA
id: check-short-sha
run: |
HASH=${{ github.sha }}
echo "::set-output name=SHA::${HASH::7}"
- name: Setup PHP
uses: pmmp/setup-php-action@2.0.0
with:
php-version: ${{ matrix.php }}
install-path: "./bin"
pm-version-major: "5"
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v3
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies (no dev)
run: composer install --prefer-dist --no-interaction --no-dev
- name: Optimize Composer autoloader
run: composer dump-autoload --optimize
- name: Build plugin Phar
run: |
rm -rf bin
mkdir build
php -dphar.readonly=0 DevTools/stub.php --make . --out "build/Texter_v${{ steps.check-texter-version.outputs.VER }}.phar"
- name: Tagging commit
id: tagging-commit
env:
TAG_NAME: v${{ steps.check-texter-version.outputs.VER }}(${{ steps.check-short-sha.outputs.SHA }})
run: |
git tag ${TAG_NAME}
git push origin ${TAG_NAME}
echo "::set-output name=TAG::refs/tags/${TAG_NAME}"
- name: Upload release artifact on Github
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: build/**
tag: ${{ steps.tagging-commit.outputs.TAG }}
pharynx:
name: Build PHAR for Poggit
runs-on: ubuntu-20.04
strategy:
matrix:
image:
- ubuntu-20.04
php:
- 8.2
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- uses: SOF3/pharynx@v0.2