-
Notifications
You must be signed in to change notification settings - Fork 21
43 lines (43 loc) · 1.71 KB
/
zipitup.yml
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
# 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@v3
- name: Build project
run: |
mkdir build
- name: Create artifact
uses: montudor/action-zip@v1
with:
args: zip -X -r build/top-10.zip . -x *.git* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist *.neon *.yml composer.* dev-helpers** build** wporg-assets** phpunit** vendor** package.json
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: top-10
path: build/top-10.zip
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: build/top-10.zip application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}