File tree Expand file tree Collapse file tree 2 files changed +30
-16
lines changed
actions/create-plugin-artifact Expand file tree Collapse file tree 2 files changed +30
-16
lines changed Original file line number Diff line number Diff line change 1+ name : ' Create Plugin Artifact'
2+ description : ' Builds and uploads a plugin artifact for a PR if a plugin directory is modified.'
3+ inputs :
4+ slug :
5+ description : ' Plugin slug (directory name under plugins/)'
6+ required : true
7+ runs :
8+ using : " composite"
9+ steps :
10+ - name : Set up PHP
11+ uses : shivammathur/setup-php@v2
12+ with :
13+ php-version : ' 7.4'
14+
15+ - name : Install dependencies and build
16+ working-directory : plugins/${{ inputs.slug }}
17+ run : |
18+ composer install --no-dev --optimize-autoloader
19+ echo "${GITHUB_SHA}" > build-sha.txt
20+ rm -f plugin-build/${{ inputs.slug }}-*.zip
21+ composer archive -vvv --format=zip --file="plugin-build/${{ inputs.slug }}" --dir="."
22+ shell : bash
23+
24+ - name : Upload plugin artifact
25+ uses : actions/upload-artifact@v4
26+ with :
27+ name : ${{ inputs.slug }}-${{ github.sha }}
28+ path : plugins/${{ inputs.slug }}/plugin-build/*.zip
Original file line number Diff line number Diff line change @@ -15,24 +15,10 @@ jobs:
1515 - name : Checkout
1616 uses : actions/checkout@v4
1717
18- - name : Set up PHP
19- uses : shivammathur/setup-php@v2
20- with :
21- php-version : ' 7.4'
22-
2318 - name : Create plugin artifact
24- working-directory : plugins/hwp-previews
25- run : |
26- composer install --no-dev --optimize-autoloader
27- echo "${GITHUB_SHA}" > build-sha.txt
28- rm -f plugin-build/hwp-previews-*.zip
29- composer archive -vvv --format=zip --file="plugin-build/hwp-previews" --dir="."
30-
31- - name : Upload plugin artifact
32- uses : actions/upload-artifact@v4
19+ uses : ./.github/actions/create-plugin-artifact
3320 with :
34- name : hwp-previews-${{ github.sha }}
35- path : plugins/hwp-previews/plugin-build/*.zip
21+ slug : hwp-previews
3622
3723 - name : Comment with artifact link
3824 uses : actions/github-script@v7
You can’t perform that action at this time.
0 commit comments