Skip to content

3.0.9

3.0.9 #24

name: Package Plugin
on:
release:
types:
- created
- updated
jobs:
deploy:
name: On Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Workflow Context
id: workflow
working-directory: ${{ runner.temp }}
env:
REPO: ${{ github.repository }}
run: |
mkdir dist
echo ::set-output name=DIST::${PWD}/dist
echo ::set-output name=PACKAGE::${REPO##*/}
- name: PHP version
run: php --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer vendor directory
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install PHP Dependencies
run: composer install --no-progress --no-dev --optimize-autoloader
- name: Prepare files
run: rsync -r --exclude-from=.distignore . ${{ steps.workflow.outputs.DIST }}/${{ steps.workflow.outputs.PACKAGE }}
- name: List Files
working-directory: ${{ steps.workflow.outputs.DIST }}
run: find .
- name: Create Zip
working-directory: ${{ steps.workflow.outputs.DIST }}
run: zip -r ${{ steps.workflow.outputs.PACKAGE }}.zip .
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets{?name,label}
asset_path: ${{ steps.workflow.outputs.DIST }}/${{ steps.workflow.outputs.PACKAGE }}.zip
asset_name: ${{ steps.workflow.outputs.PACKAGE }}.zip
asset_content_type: application/zip