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
# GitHub Action: whenever creating a new release of the source code, | |
# also create a release of the installable plugin. | |
# Steps to execute: | |
# - Checkout the source code | |
# - Run "composer install" to download all dependencies under vendor/ | |
# - Create a .zip file, excluding: | |
# - All hidden files (.git, .gitignore, etc) | |
# - All development files, ending in .dist | |
# - All composer files <= after installing dependencies, no need for them anymore | |
# - Markdown files concerning development | |
# - Folder build/ <= created only to store the .zip file | |
# - Folder dev-helpers/ <= not needed for the plugin | |
# - Upload the .zip file as an artifact to the action (this step is possibly optional) | |
# - Upload the .zip file as a release, for download | |
name: Generate Installable Plugin, and Upload as Release Asset | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build project | |
run: | | |
mkdir build | |
- name: Create artifact | |
uses: montudor/action-zip@v1 | |
with: | |
args: zip -X -r build/better-search.zip . -x *.git* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist *.yml composer.* dev-helpers** build** wporg-assets** phpunit** | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: better-search | |
path: build/better-search.zip | |
- name: Upload to release | |
uses: JasonEtco/upload-to-release@master | |
with: | |
args: build/better-search.zip application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |