Tweak WPCS #57
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
on: | |
release: | |
types: [published] | |
push: | |
tags: | |
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
name: Upload Release Asset | |
jobs: | |
build: | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build project for Pre-release | |
if: 'github.event.prerelease' | |
run: | | |
mkdir -p assets | |
for folder in src/* ; do | |
ext_dir=$(basename "${folder}") | |
[ -d $folder ] && cd "src/${ext_dir%/}" && composer install --no-dev && cd ../ && zip -r "../assets/${ext_dir%/}" "${ext_dir%/}" && cd ../ | |
done | |
ls -a | |
zip -r assets.zip assets/ | |
- name: Build project | |
if: '!github.event.prerelease' | |
run: | | |
ls -a | |
mkdir -p assets | |
for folder in src/* ; do | |
ext_dir=$(basename "${folder}") | |
[ -d $folder ] && cd "src/${ext_dir%/}" && composer install --no-dev && cd ../ && zip -r "../assets/${ext_dir%/}" "${ext_dir%/}" && cd ../ | |
done | |
cd ../../ | |
ls -a | |
zip -r assets.zip assets/ | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: true | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./assets.zip | |
asset_name: Individual-Extensions.zip | |
asset_content_type: application/zip |