1
0
Fork 0
mirror of https://github.com/elementor/hello-theme.git synced 2026-07-27 14:01:37 +08:00
hello-theme/.github/workflows/deploy.yml
Manor Hazaz a8cd5d7403
Some checks failed
Build / Build theme (push) Has been cancelled
Lint / ESLint (push) Has been cancelled
Lint / PHPCS (push) Has been cancelled
PHPUnit / File Diff (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 7.4 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 7.4 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 7.4 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 7.4 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 8.0 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 8.0 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 8.0 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.0 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 8.1 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 8.1 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 8.1 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.1 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 8.2 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 8.2 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 8.2 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.2 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 8.3 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 8.3 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 8.3 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.3 (push) Has been cancelled
PHPUnit / PHPUnit - Test Results (push) Has been cancelled
Internal: Fix deploy action [TMZ-1013] (#614) (#615)
* Internal: Fix deploy action [TMZ-1013]

* add validation
2026-01-21 13:44:47 +00:00

85 lines
2.9 KiB
YAML

name: Deploy
permissions:
contents: read
actions: read
on:
workflow_dispatch:
inputs:
version:
description: 'Write the Theme version that sis about to get released to Production WordPress.org SVN'
required: true
type: string
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate branch name
run: |
BRANCH_NAME="${{ github.ref_name }}"
if [[ ! "$BRANCH_NAME" =~ ^[0-9]+\.[0-9]+ ]]; then
echo "::error::Branch name must match pattern (e.g., 3.4, 3.5). Current branch: $BRANCH_NAME"
exit 1
fi
- name: Validate version input
run: |
PACKAGE_VERSION=$(cat package.json | jq -r '.version')
INPUT_VERSION="${{ inputs.version }}"
if [ "$INPUT_VERSION" != "$PACKAGE_VERSION" ]; then
echo "::error::Input version ($INPUT_VERSION) does not match package.json version ($PACKAGE_VERSION)"
exit 1
fi
build:
needs: validate
if: ( github.actor == 'ManorHazaz' || github.actor == 'hein-obox' || github.actor == 'KingYes' || github.actor == 'arielk' || github.actor == 'nicoladj77' ) && startsWith( github.repository, 'elementor/' )
uses: ./.github/workflows/build.yml
secrets: inherit
deploy:
needs: [validate, build]
if: needs.validate.result == 'success' && needs.build.result == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Preparing envs
run: |
echo "THEME_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: hello-elementor
- name: Extract Hello Theme build
run: |
HT_ZIP=$(find . -name "hello-elementor-*.zip" -o -name "hello-elementor.*.zip" -type f | head -1)
unzip -q "$HT_ZIP" -d ./tmp/
mv ./tmp/hello-elementor ./hello-elementor
rm -rf ./tmp
- name: Validate changelog
env:
VERSION: ${{ env.THEME_VERSION }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/validate-changelog.sh"
- name: Install SVN
run: |
sudo apt-get update -y
sudo apt-get install -y subversion
which svn
svn --version
- name: Publish to WordPress.org SVN
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-theme-to-wordpress-org.sh"
- name: Send Slack Notification
uses: ./.github/actions/theme-slack-notification-release
with:
CLOUD_SLACK_BOT_TOKEN: ${{ secrets.CLOUD_SLACK_BOT_TOKEN }}
PACKAGE_VERSION: ${{ env.THEME_VERSION }}
SLACK_CHANNEL: "#tmz-hello-delivery"