7.50.0-beta.2 #426
Workflow file for this run
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' | |
env: | |
PHP_VERSION: '7.4' | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
name: Build cecil.phar | |
runs-on: ubuntu-latest | |
outputs: | |
previous_release: ${{ steps.previous_release.outputs.tag }} | |
version: ${{ steps.get_version.outputs.version }} | |
shasum: ${{ steps.sha256.outputs.shasum }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get previous release | |
id: previous_release | |
run: | | |
echo "tag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)" >> $GITHUB_OUTPUT | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
extensions: mbstring, intl, gettext, fileinfo | |
coverage: none | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
vendor | |
tests/fixtures/website/themes | |
key: composer-ubuntu-latest-php-${{ env.PHP_VERSION }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
composer-ubuntu-latest-php-${{ env.PHP_VERSION }}- | |
- name: Validate composer.json | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: composer validate | |
- name: Install dependencies | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: | | |
composer install --prefer-dist --no-progress | |
composer dump-autoload --optimize | |
- name: Run build test | |
run: composer run-script test | |
- name: Get version | |
id: get_version | |
run: | | |
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
echo "${GITHUB_REF#refs/tags/}" > VERSION | |
- name: Build cecil.phar | |
run: composer run-script box | |
- name: Test cecil.phar | |
run: | | |
cd dist | |
mkdir skeleton | |
php cecil.phar new:site skeleton -f | |
php cecil.phar build skeleton | |
php cecil.phar show:content skeleton | |
rm -rf skeleton | |
- name: Test cecil.phar (debug on) | |
env: | |
CECIL_DEBUG: 'true' | |
run: | | |
cd dist | |
mkdir skeleton | |
php cecil.phar new:site skeleton -f | |
php cecil.phar build skeleton -vvv | |
php cecil.phar show:content skeleton | |
- name: Set SHA256 | |
id: sha256 | |
run: | | |
echo "shasum=$(shasum -a 256 ./dist/cecil.phar | awk '{printf $1}')" >> $GITHUB_OUTPUT | |
- name: Upload cecil.phar | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cecil.phar | |
path: dist/cecil.phar | |
if-no-files-found: error | |
deploy_to_github: | |
name: Deploy cecil.phar to GitHub | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download cecil.phar | |
uses: actions/download-artifact@v3 | |
with: | |
name: cecil.phar | |
- name: Get release | |
id: release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add cecil.phar to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: cecil.phar | |
asset_name: cecil.phar | |
asset_content_type: application/octet-stream | |
- name: Generate changelog | |
id: changelog | |
uses: jaywcjlove/[email protected] | |
with: | |
base-ref: ${{ needs.build.outputs.previous_release }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
filter: (^[U|u]pdate|Merge) | |
- name: Update release | |
id: update_release | |
uses: tubone24/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: | | |
${{ steps.changelog.outputs.changelog }} | |
${{ steps.changelog.outputs.compareurl }} | |
deploy_to_website: | |
name: Deploy cecil.phar to website | |
runs-on: ubuntu-latest | |
needs: build | |
if: "!github.event.release.prerelease" | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Download cecil.phar | |
uses: actions/download-artifact@v3 | |
with: | |
name: cecil.phar | |
path: dist | |
- name: Push files | |
run: bash ./scripts/deploy-dist.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.REPOS_TOKEN }} | |
update_homebrew_formula: | |
name: Update Homebrew Formulae | |
runs-on: macos-latest | |
needs: [build, deploy_to_github] | |
steps: | |
- name: Bump Formula PR | |
env: | |
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.REPOS_TOKEN }} | |
run: | | |
brew tap cecilapp/cecil | |
brew bump-formula-pr -f --version=${{ needs.build.outputs.version }} --no-browse --no-audit \ | |
--sha256=${{ needs.build.outputs.shasum }} \ | |
--url="https://github.com/Cecilapp/Cecil/releases/download/${{ needs.build.outputs.version }}/cecil.phar" \ | |
cecilapp/cecil/cecil |