Skip to content

1.0.1

1.0.1 #3

Workflow file for this run

name: Add release ZIP
on:
release:
types: [published]
jobs:
create-zip:
runs-on: ubuntu-latest
steps:
- name: Set environment variables
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: |
# process existing variables
PLUGIN_SLUG="wpo-ips-default-templates"
VERSION="${TAG_NAME#v}"
ZIP_FILE_NAME=$PLUGIN_SLUG.$VERSION.zip
# set environment variables
echo "plugin_slug=$PLUGIN_SLUG" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_ENV
echo "zip_file_name=$PLUGIN_SLUG.$VERSION.zip" >> $GITHUB_ENV
- name: Checkout Git repository
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
path: ${{ env.plugin_slug }}
submodules: true
- name: Create ZIP
run: |
# reformat .distignore: remove all empty lines, leading slashes and prefix with the folder
sed "/^[[:space:]]*$/d;s#^/##;s#^#${{ env.plugin_slug }}/#" ${{ env.plugin_slug }}/.distignore > .zipignore
# create zip file
zip -rq ${{ env.zip_file_name }} ${{ env.plugin_slug }} [email protected]
- name: Add ZIP to release asseets
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ env.zip_file_name }}
gzip: false
allow_override: true