v1.9.1 #53
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: | |
release: | |
types: [released] | |
env: | |
PLUGIN_SLUG: syntatis-feature-flipper | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "7.4" | |
tools: composer:v2 | |
- name: Install dependencies | |
run: | | |
npm install | |
composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader | |
- name: Build plugin | |
run: | | |
npm run build | |
composer run build | |
composer run plugin:zip -- --file=build | |
unzip build.zip -d build | |
- name: "Check latest tagged version" | |
if: ${{ github.event_name == 'release' }} | |
run: | | |
LATEST_TAG="${{ github.ref_name }}"; | |
HEADER_VERSION="v$(sed -n -e '0,/^\s*\* Version:\s\+\([0-9].\+\)$/ s##\1#p' syntatis-feature-flipper.php)"; | |
PLUGIN_VERSION="v$(sed -n -e "0,/^const PLUGIN_VERSION = '\\([0-9].\\+\\)';$/ s##\\1#p" syntatis-feature-flipper.php)"; | |
README_VERSION="v$(sed -n -e '0,/^Stable tag: \([0-9].\+\)$/ s##\1#p' readme.txt | tr -d '[:space:]')"; | |
if [[ "${LATEST_TAG}" != "${HEADER_VERSION}" || "${LATEST_TAG}" != "${PLUGIN_VERSION}" || "${LATEST_TAG}" != "${README_VERSION}" ]]; | |
then | |
echo "::error::Latest tag differs from current version" | |
exit 10 | |
fi | |
- name: Deploy to WordPress.org | |
uses: 10up/action-wordpress-plugin-deploy@stable | |
with: | |
dry-run: ${{ github.event_name != 'release' }} | |
env: | |
ASSETS_DIR: .wporg | |
BUILD_DIR: build | |
SLUG: ${{ env.PLUGIN_SLUG }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} |