Release Build #5
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 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 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: mbstring, intl, zip # Укажите нужные расширения | |
tools: composer | |
# 3. Installing dependencies | |
- name: Install dependencies | |
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}' |