Skip to content

Commit 80fc033

Browse files
committed
2 parents 3f846a8 + 136beab commit 80fc033

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# GitHub Action: whenever creating a new release of the source code,
2+
# also create a release of the installable plugin.
3+
# Steps to execute:
4+
# - Checkout the source code
5+
# - Run "composer install" to download all dependencies under vendor/
6+
# - Create a .zip file, excluding:
7+
# - All hidden files (.git, .gitignore, etc)
8+
# - All development files, ending in .dist
9+
# - All composer files <= after installing dependencies, no need for them anymore
10+
# - Markdown files concerning development
11+
# - Folder build/ <= created only to store the .zip file
12+
# - Folder dev-helpers/ <= not needed for the plugin
13+
# - Upload the .zip file as an artifact to the action (this step is possibly optional)
14+
# - Upload the .zip file as a release, for download
15+
name: Generate Installable Plugin, and Upload as Release Asset
16+
on:
17+
release:
18+
types: [published]
19+
jobs:
20+
build:
21+
name: Upload Release Asset
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: write # This gives permission to create releases
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Build project
30+
run: |
31+
mkdir build
32+
33+
- name: Create artifact
34+
uses: montudor/action-zip@v1
35+
with:
36+
args: zip -X -r build/sk-multi-address.zip . -x *.git* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist *.yml *.neon composer.* dev-helpers** build** wporg-assets** phpunit**
37+
38+
- name: Upload artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: sk-multi-address
42+
path: build/sk-multi-address.zip
43+
44+
- name: Upload Release Asset
45+
uses: softprops/action-gh-release@v1
46+
if: startsWith(github.ref, 'refs/tags/')
47+
with:
48+
files: build/sk-multi-address.zip
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)