Skip to content

Commit

Permalink
Create release-master.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
brlumen authored Jan 11, 2025
1 parent f981967 commit a4a8fcc
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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' }}
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' }}
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}'

0 comments on commit a4a8fcc

Please sign in to comment.