-
Notifications
You must be signed in to change notification settings - Fork 43
66 lines (64 loc) · 2.13 KB
/
build-tag-release.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build, Tag and Release
on:
push:
branches:
- release
permissions:
pull-requests: write
contents: write
jobs:
check-status:
name: Check Status
runs-on: ubuntu-latest
outputs:
is-plugin-update: ${{ steps.set-outputs.outputs.is-plugin-update }}
steps:
- uses: actions/checkout@v4
- id: get-changed-files
uses: jitterbit/get-changed-files@v1
- id: set-outputs
shell: bash
run: |
echo "Changed files: ${{ steps.get-changed-files.outputs.all }}"
shopt -s nocasematch
run_plugin_update="false"
for file in ${{ steps.get-changed-files.outputs.all }}; do
echo "Checking if file '$file' should trigger a plugin release"
if
[[ "$file" != */.wordpress.org/* ]] && \
[[ "$file" != */.github/* ]] && \
[[ "$file" != */readme.* ]] && \
[[ "$file" != */.gitattributes ]] && \
[[ "$file" != */.gitignore ]] && \
[[ "$file" != */catalog-info.yml ]] && \
[[ "$file" != *composer* ]]; then
echo "'$file' is not an ignored file."
run_plugin_update="true"
break
fi
done
echo "::set-output name=is-plugin-update::$run_plugin_update"
asset-only:
name: WP.org Asset Only Update
needs: check-status
if: ${{ needs.check-status.outputs.is-plugin-update == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: WP.org Asset Only Update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
tag:
needs: check-status
if: ${{ needs.check-status.outputs.is-plugin-update == 'true' }}
name: Create Tag and Draft Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build, Tag & Release
uses: pantheon-systems/plugin-release-actions/build-tag-release@main
with:
gh_token: ${{ github.token }}
readme_md: README.md