release-2.8.0 #4
Workflow file for this run
This file contains hidden or 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 Build | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build-and-package: | |
name: Build and Package | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Cloning the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# 2. Install PHP and Composer | |
- name: Setup PHP | |
if: ${{ github.event.release.target_commitish != 'master-2.6.x' }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: mbstring, intl, zip | |
tools: composer | |
# 3. Installing dependencies | |
- name: Install dependencies | |
if: ${{ github.event.release.target_commitish != 'master-2.6.x' }} | |
run: composer install --no-dev --optimize-autoloader | |
# 4. Creating an archive | |
- name: Create Release Archive | |
run: | | |
zip -r Calendar-${{ github.event.release.tag_name }}.zip ./Calendar -x ".git*" "tests/*" ".github/*" | |
# 5. Uploading the archive to the release | |
- name: Upload to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./Calendar-${{ github.event.release.tag_name }}.zip | |
asset_name: Calendar-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip | |
# 6. Moving the release from preliminary to final | |
# - name: Finalize Release | |
# run: | | |
# curl -X PATCH \ | |
# -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
# -H "Accept: application/vnd.github+json" \ | |
# https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }} \ | |
# -d '{"prerelease": false}' |