chevereto-free/.github/workflows/release.yml

73 lines
2.2 KiB
YAML

name: Release
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.4"]
name: Release on PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
env:
fail-fast: true
- name: Validate composer
run: composer validate
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Packaging
run: |
rm -rf .git .github .dockerignore docs app/settings.php docker-bake.hcl httpd-php-dev.yml httpd-php.Dockerfile httpd-php.yml sync.sh
- name: Archive dev
uses: thedoctor0/zip-release@master
with:
type: "zip"
filename: "${{ steps.get_version.outputs.VERSION }}-lite.zip"
- name: Install dependencies
run: composer install --prefer-dist --no-progress --classmap-authoritative --ignore-platform-reqs
- name: Archive release
uses: thedoctor0/zip-release@master
with:
type: "zip"
filename: "${{ steps.get_version.outputs.VERSION }}.zip"
exclusions: "${{ steps.get_version.outputs.VERSION }}-lite.zip"
- name: Upload artifacts
uses: ncipollo/release-action@v1
with:
allowUpdates: true
removeArtifacts: true
omitBodyDuringUpdate: true
artifacts: "${{ steps.get_version.outputs.VERSION }}.zip,${{ steps.get_version.outputs.VERSION }}-lite.zip"
token: ${{ secrets.GITHUB_TOKEN }}