Merge branch 'dev/4.3' #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |