Skip to content

v0.4.0 - 2024-12-28 #18

v0.4.0 - 2024-12-28

v0.4.0 - 2024-12-28 #18

name: Upload Schema Artifact
on:
release:
types: [ published ]
jobs:
run:
runs-on: ubuntu-latest
name: Generate and Upload WPGraphQL Schema Artifact
services:
mysql:
image: mariadb:10
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: password
# Ensure docker waits for mariadb to start
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP w/ Composer & WP-CLI
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql
coverage: none
tools: composer:v2, wp-cli
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Setup WordPress
run: |
cp .env.dist .env
# Append to the .env file
echo "INCLUDE_EXTENSIONS=${{ env.INCLUDE_EXTENSIONS }}" >> .env
composer run install-test-env
env:
INCLUDE_EXTENSIONS: ''
- name: Generate the Static Schema
run: |
cd /tmp/wordpress/
# Output: /tmp/schema.graphql
wp graphql generate-static-schema
- name: Upload schema as release artifact
uses: softprops/action-gh-release@v2
with:
files: /tmp/schema.graphql
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}