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
# This snippet is adapted from graphql-api-for-wp. | |
# | |
# 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 | |
# - 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 tests/ <= 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] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build project | |
run: | | |
mkdir gravitywp-connector-for-gravityforms-mailpoet | |
rsync -a ./ ./gravitywp-connector-for-gravityforms-mailpoet --exclude gravitywp-connector-for-gravityforms-mailpoet | |
mkdir build | |
- name: Create artifact | |
uses: montudor/action-zip@v1 | |
with: | |
args: zip -X -r build/gravitywp-connector-for-gravityforms-mailpoet-${{ github.event.release.tag_name }}.zip gravitywp-connector-for-gravityforms-mailpoet -x *.git* *node_modules/\* .* "*/\.*" *CODE_OF_CONDUCT.md *readme-dev.md *.phar *appsero.json *CONTRIBUTING.md *ISSUE_TEMPLATE.md *PULL_REQUEST_TEMPLATE.md *.dist *.neon *composer* *package* *phpunit* *webpack* *tests** | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gravitywp-connector-for-gravityforms-mailpoet | |
path: build/gravitywp-connector-for-gravityforms-mailpoet-${{ github.event.release.tag_name }}.zip | |
- name: Upload release asset | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: build/gravitywp-connector-for-gravityforms-mailpoet-${{ github.event.release.tag_name }}.zip | |
env: | |
GITHUB_TOKEN: ${{ github.token }} |