-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.36 KB
/
create_plugin_zip.yml
File metadata and controls
43 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Create Plugin ZIP
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Get ZIP structure
id: zip_structure
run: |
FILES=$(jq -r '.entries[]' .to_zip.json | paste -sd " " -)
ROOT=$(jq -r '.root' .to_zip.json)
echo "root=$ROOT" >> $GITHUB_OUTPUT
echo "files=$FILES" >> $GITHUB_OUTPUT
- name: Create ZIP
run: |
mkdir -p "tempzip/${{ steps.zip_structure.outputs.root }}"
cp -r ${{ steps.zip_structure.outputs.files }} "tempzip/${{ steps.zip_structure.outputs.root }}"
find "tempzip" -type d -name "__pycache__" -exec rm -r {} +
cd tempzip
zip -r plugin.zip ${{ steps.zip_structure.outputs.root }}
cd ..
- name: Upload ZIP to release
uses: softprops/action-gh-release@v2
with:
files: tempzip/plugin.zip
token: ${{ secrets.GH_TOKEN }}
- name: Dispatch
uses: peter-evans/repository-dispatch@v4
with:
token: '${{ secrets.GH_TOKEN }}'
event-type: plugin_zip_generated
client-payload: '{"url": "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/plugin.zip"}'