-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathaction.yml
More file actions
92 lines (78 loc) · 3.02 KB
/
action.yml
File metadata and controls
92 lines (78 loc) · 3.02 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: 'Test Plugin Deploy'
description: 'Upload zip file to releases tab'
branding:
icon: 'upload-cloud'
color: 'blue'
outputs:
zip-path:
description: 'Path to zip file'
value: ${{ steps.zip.outputs.zip-path }}
org-zip-path:
description: 'Path to .org zip file'
value: ${{ steps.zip-org.outputs.zip-path }}
runs:
using: 'composite'
steps:
- id: prepare
name: Prepare Environment
run: |
sudo apt-get update && sudo apt-get install zip rsync -y
shell: bash
- id: zip
name: Zip Plugin (Main)
run: |
# Create dist folder and copy files while excluding .distignore items
mkdir -p dist
rsync -av --exclude-from="${{ env.PLUGIN_DIR }}/.distignore" ${{ env.PLUGIN_DIR }}/ dist/${{ env.SLUG }}
zip_file="faustwp-${{ env.VERSION }}.zip"
zip -r "$zip_file" "dist/${{ env.SLUG }}"
# Save zip path to output
echo "::set-output name=zip-path::$PWD/$zip_file"
shell: bash
- id: zip-org
name: Zip Plugin (.org version)
run: |
# Delete old directory
rm -rf dist
# Create dist folder and copy files while excluding .distignore items
mkdir -p dist
# Copy plugin files to dist folder and exclude external updater
rsync -av --exclude-from="${{ env.PLUGIN_DIR }}/.distignore" --exclude="includes/updates" "${{ env.PLUGIN_DIR }}/" "dist/${{ env.SLUG }}"
# Updates for the CHANGELOG file
sed -i '' -e 's/plugin updates from an external API endpoint./plugin updates from an external API endpoint when not installed from WordPress.org/' "dist/${{ env.SLUG }}/CHANGELOG.md"
# Create .org zip file
org_zip_file="faustwp-${{ env.VERSION }}.org.zip"
zip -r "$org_zip_file" "dist/${{ env.SLUG }}"
# Save zip path to output
echo "::set-output name=zip-path::$PWD/$org_zip_file"
shell: bash
- id: debug-main
name: Debug Check Main Zip File
run: |
echo "Main zip file path: ${{ steps.zip.outputs.zip-path }}"
ls -lah ${{ steps.zip.outputs.zip-path }}
unzip -l ${{ steps.zip.outputs.zip-path }}
shell: bash
- id: debug-org
name: Debug Check .org Zip File
run: |
echo ".org zip file path: ${{ steps.zip-org.outputs.zip-path }}"
ls -lah ${{ steps.zip-org.outputs.zip-path }}
unzip -l ${{ steps.zip-org.outputs.zip-path }}
shell: bash
# - id: upload-main
# name: Upload Main Zip File to Release
# uses: softprops/action-gh-release@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# files: ${{ steps.zip.outputs.zip-path }}
# asset_name: faustwp-${{ env.VERSION }}.zip
# overwrite: true
# - id: upload-org
# name: Upload .org Zip File to Release
# uses: softprops/action-gh-release@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# files: ${{ steps.zip-org.outputs.zip-path }}
# asset_name: faustwp-${{ env.VERSION }}.org.zip
# overwrite: true