Skip to content

Publish plugin

Publish plugin #20

Workflow file for this run

name: Publish plugin
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10
env:
PLUGIN_NAME: ${{ github.event.repository.name }}
RELEASE_VER: ${{ github.ref }}
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create release and Upload
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME=${RELEASE_VER##*/}
mkdir "${PLUGIN_NAME}"
assets=()
for f in main.js manifest.json styles.css; do
if [[ -f $f ]]; then
cp $f "${PLUGIN_NAME}/"
assets+=("$f")
fi
done
zip -r "$PLUGIN_NAME".zip "$PLUGIN_NAME"
gh release create "$TAG_NAME" -t "$TAG_NAME" -n "### $COMMIT_MESSAGE"
gh release upload --clobber "$TAG_NAME" "${assets[@]}" "$PLUGIN_NAME".zip