-
Notifications
You must be signed in to change notification settings - Fork 26
59 lines (51 loc) · 1.89 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (51 loc) · 1.89 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
name: Deploy to wordpress.org
on:
release:
types: [published]
jobs:
deploy:
name: Deploy to WordPress.org
if: github.event.release.prerelease != true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Install dependencies
run: pnpm install
- name: Build
id: build
uses: wpeverest/action-build@4.0.2
- name: Delete existing SVN tag if exists
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
run: |
sudo apt-get install -y subversion
TAG_VERSION="${{ github.event.release.tag_name }}"
TAG_VERSION="${TAG_VERSION#v}"
SVN_TAG_URL="https://plugins.svn.wordpress.org/user-registration/tags/${TAG_VERSION}"
echo "Checking for tag at: $SVN_TAG_URL"
HTTP_STATUS=$(curl -o /dev/null -s -w "%{http_code}" -L --max-redirs 5 "$SVN_TAG_URL")
echo "HTTP Status: $HTTP_STATUS"
if [ "$HTTP_STATUS" = "200" ] || [ "$HTTP_STATUS" = "301" ]; then
echo "Tag ${TAG_VERSION} exists, deleting..."
svn delete "$SVN_TAG_URL" \
--username "$SVN_USERNAME" \
--password "$SVN_PASSWORD" \
--no-auth-cache \
--non-interactive \
-m "Removing incomplete tag ${TAG_VERSION} for redeployment"
echo "Tag deleted successfully."
else
echo "Tag ${TAG_VERSION} does not exist (HTTP $HTTP_STATUS), skipping delete."
fi
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@master
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: user-registration