Skip to content

Build release zip

Build release zip #2

name: Build release zip
on:
workflow_dispatch:
release:
types: [published]
jobs:
build_zip:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: |
composer install --no-dev
composer build-zip
rm -rf ./release && unzip ${{ github.event.repository.name }}.zip -d ./release
- name: Upload the ZIP file as an artifact
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: release
retention-days: 5
- name: Upload release asset
if: ${{ github.event_name == 'release' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{github.workspace}}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip