chore: release 6.0.15 #13
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: Upload Release Asset | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
ARCHIVE_NAME: 'shoppingfeed-advanced.zip' | |
jobs: | |
build: | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build project PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.2 | |
- name: Install PHP dependencies | |
run: | | |
# Don't include composer installer in WP plugin archive | |
composer remove composer/installers --no-install | |
# Install PHP dependencies | |
composer install --prefer-dist --no-dev -o --ignore-platform-reqs | |
- name: Build Zip | |
run: | | |
echo "ℹ︎ Create release folder" | |
if [ ! -e "./bin/release/" ]; then | |
mkdir -p bin/release | |
fi | |
echo "ℹ︎ Remove any existing zip file" | |
rm -f bin/release/*.zip | |
echo "ℹ︎ Copy files based on .distignore" | |
rsync -rcv --exclude-from=".distignore" ./ bin/release --delete | |
echo "Creating archive..." | |
cd bin/release | |
zip -r ../${{ env.ARCHIVE_NAME }} ./* | |
- 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: false | |
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: ./bin/${{ env.ARCHIVE_NAME }} | |
asset_name: ${{ env.ARCHIVE_NAME }} | |
asset_content_type: application/zip |