3.0.8 #23
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: 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 |