Skip to content

Merge pull request #421 from CPS-IT/docs/admonitions #25

Merge pull request #421 from CPS-IT/docs/admonitions

Merge pull request #421 from CPS-IT/docs/admonitions #25

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
phar:
name: Compile PHAR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Check if tag is valid
- name: Check tag
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
# Prepare environment
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2, phive
# Compile PHAR
- name: Install box
# @todo Switch back to latest release of humbug/box once support for PHP 8.1 is dropped
run: phive install --trust-gpg-keys 2DF45277AEF09A2F humbug/box@4.5.1
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--no-dev"
- name: Compile PHAR
run: ./tools/box compile
# Upload compiled PHAR as artifact
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: phar
path: |
.build/frontend-asset-handler.phar
release:
name: Create release
if: ${{ github.event_name != 'workflow_dispatch' }}
runs-on: ubuntu-latest
needs: phar
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Check if tag is valid
- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
# Download PHAR
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: phar
path: .build
- name: Make PHAR executable
run: chmod +x .build/frontend-asset-handler.phar
# Sign PHAR file
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PHAR_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PHAR_GPG_PASSPHRASE }}
- name: Sign PHAR file
run: gpg --armor --output .build/frontend-asset-handler.phar.asc --yes --detach-sig .build/frontend-asset-handler.phar
# Create release
- name: Create release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.RELEASE_TOKEN }}
generateReleaseNotes: true
artifacts: .build/frontend-asset-handler.phar,.build/frontend-asset-handler.phar.asc