Skip to content

Deploy to WordPress.org #2

Deploy to WordPress.org

Deploy to WordPress.org #2

Workflow file for this run

name: Deploy to WordPress.org
on:
release:
types: [ released ]
jobs:
release:
name: New release
runs-on: ubuntu-latest
environment: live
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none
- name: Install composer dependencies
uses: php-actions/composer@v5
with:
php_version: 8.0
dev: no
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: Install npm dependencies
run: |
npm install -g npm@latest
npx update-browserslist-db@latest
npm ci
- name: Build assets for production
run: npm run build
- name: Generate pot file
run: |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
php -d xdebug.mode=off "$(which wp)" i18n make-pot ${{github.workspace}} ${{github.workspace}}/languages/blocks-for-github.pot --exclude="$(cat .distignore | tr "\n" "," | sed 's/,$/ /' | tr " " "\n"),src/**/*.js,*.js.map"
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: blocks-for-github
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{github.workspace}}/blocks-for-github.zip
asset_name: blocks-for-github.zip
asset_content_type: application/zip