Skip to content

Commit

Permalink
Fix main merge conflict in Deny Public Access Callback (#633)
Browse files Browse the repository at this point in the history
* refactor: simplify public route redirection by using template_redirect (#575)

* Update API Router `import` in Auth Docs (#580)

* doc: (#519) adding examples for getStaticPaths

* Update API Router auth import docs

* Update API Router imports to use `@faustjs/core/api`

Co-authored-by: William Johnston <will@wwj.dev>

* chore: remove unused wp-env dependency

* chore: use Faust WP in comment text

* chore: set minimum PHP to 7.2

* refactor: text domain wpe-headless -> faustwp

* refactor: global consts WPE_HEADLESS -> FAUSTWP

* refactor: replace function prefixes with namespace

* refactor: settings slug to faustwp-settings

* refactor: local variable prefixes to faustwp

* refactor: filter prefixes wpe_headless -> faustwp

* refactor: script handle prefixes to faustwp

* refactor: id attribute prefix to faustwp

* refactor: REST API namespace wpac -> faustwp

* style: phpcs

* Revert "refactor: REST API namespace wpac -> faustwp"

This reverts commit 30d4488.

* chore: add license file and plugin headers

* style: change Faust WP to FaustWP

* fix: remove redirect to settings on activation (#595)

* Setup GitHub Actions for Testing/Linting Plugin (#582)

* Lint plugin

* Run unit tests via docker/github actions

* Use -T in docker-compose

* Use docker command instead of docker compose

* Remove interactive tty

* List files in dir

* Simplify docker from

* Fix wp-cli

* Use wp cli from run step

* Run unit test on windows

* Test docker unit tests with macos

* Remove volume from docker compose

* inspect container

* Add working-directory to inspect step

* Use entrypoint/cmd

* Sleep for 30 secs

* Link db

* Try simplifying testing env

* Use more verbose phpunit command

* Check current dir

* Composer install

* Clean up test action

* Set sleep to 15 seconds

* Fix CircleCI test

* Update documentation

* Update action names

* chore: update plugin URI (#596)

* refactor: Remove CircleCI Config (#597)

* Update plugin file and folder name to faustwp (#600)

* chore: delete unused wp-env config

* chore: prepare for plugin file/folder rename

* refactor: plugin file/folder name to faustwp

* chore: update WPE Headless to FaustWP

* test: update e2e test db

* Core refactor (#601)

* #590 exporting auth, moving all exports into export folder

* #590 exporting utils

* #590 exporting config

* #590 exporting client

* #590 removing most of schema.generated, exporting only getClient, config, and related types

* #590 Headless -> Faust.js

* #590 HeadlessConfig -> Config

* #590 HeadlessConfig -> ClientConfig

* chore: changeset

* fix: core test imports

* chore: updating packages

* fix: only one failing test based on no exports support from jest 27

* fix: fixing tests, updating dependencies

* Create E2E action (#599)

* Create E2E action

* Setup PHP and Node

* Ensure frontend process doesn't hang

* Don't use docker compose in exec scripts

* Add sleep for DB to accept connections

* Add working directory to setup tests step

* Use Allow root wp cli

* Setup chrome

* Fix chrome version step syntax

* Chrome/ChromeDriver is already installed on action

* Add chrome driver args for GH Actions

* e2e Click preview link and determine if correct preview page is fetched

* Revert preview link href assertion removal

* Wait for previewlinks.js to modify button href before checking preview link

* fix: headless post previews URL (#602)

* Version Packages (#603)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: start unreleased changelog for FaustWP (#604)

* chore: Upload test artifact upon failure (#606)

* chore: Upload test artifact upon failure

* fix: increase wait time for preview test to 14 seconds

* Rename settings option to faustwp_settings (#607)

* refactor: rename settings option to faustwp_settings

* feat: add database upgrade functions

* Release `faustwp` plugin action (#608)

* feat: create wordpress.org deploy GH action

* docs: reflect new release steps

* chore: add dist ignore for plugin release

* chore: copy 10up action src

* refactor: option to specify plugin src dir

* refactor: use release-pugin local action

* fix: e2e plugin npm deps install (#609)

* fix: NPM deps install

* Squashed commit of the following:

commit 40d08d0
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 13:47:00 2021 -0700

    fix: exporting components from declaration

commit 145ef99
Merge: 632a57f 4d7f981
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 10:46:13 2021 -0700

    Merge branch 'canary' into next-refactor

commit 632a57f
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 10:05:38 2021 -0700

    feat: (#591) adding changeset denoting breaking change

commit 7f2a760
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 09:55:23 2021 -0700

    feat: (#591) limiting root @faustjs/next exports to those needed by client

commit b1ba602
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 09:48:03 2021 -0700

    feat: (#591) creating @faustjs/next/components export

commit e4ad3ea
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 09:46:28 2021 -0700

    feat: (#591) creating @faustjs/next/server export

commit 69b6321
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 09:43:46 2021 -0700

    feat: (#591) creating @faustjs/next/log export

commit 9be7e1d
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 09:41:23 2021 -0700

    feat: (#591) creating @faustjs/next/config export

commit 664bb90
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 09:38:01 2021 -0700

    feat: (#591) creating @faustjs/next/utils export

commit 38888e8
Author: William Johnston <will@wwj.dev>
Date:   Fri Oct 22 09:36:51 2021 -0700

    feat: (#591) migrating to src/gqty and exposing @faustjs/next/client

* fix: add build step

* refactor: use dev:next:getting-started command

* Revert "Squashed commit of the following:"

This reverts commit d15356f.

* Next refactor (#605)

* feat: (#591) migrating to src/gqty and exposing @faustjs/next/client

* feat: (#591) creating @faustjs/next/utils export

* feat: (#591) creating @faustjs/next/config export

* feat: (#591) creating @faustjs/next/log export

* feat: (#591) creating @faustjs/next/server export

* feat: (#591) creating @faustjs/next/components export

* feat: (#591) limiting root @faustjs/next exports to those needed by client

* feat: (#591) adding changeset denoting breaking change

* fix: exporting components from declaration

Co-authored-by: Blake Wilson <blake.wilson@wpengine.com>

* Version Packages (#613)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: remove react example (#618)

* docs: update tutorial sidebar label (#620)

* Grammar Dev Env Setup (#630)

* Grammar edits to basic headless site (#629)

* Breakout Hooks Docs into Seperate Pages (#632)

* doc: (#519) adding examples for getStaticPaths

* Update API Router auth import docs

* Update API Router imports to use `@faustjs/core/api`

* Breakout Hooks into individual Pages (#631)

* docs: break out hooks

* Update links to appropriate hooks url

* Logging queries guide

* Fix docs site URLs

* Fix hooks links

Co-authored-by: William Johnston <will@wwj.dev>

Co-authored-by: Andrew Matthews <andrew.matthews@wpengine.com>
Co-authored-by: William Johnston <will@wwj.dev>
Co-authored-by: Will Johnston <wjohnsto@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nate Archer <12628964+narcher7@users.noreply.github.com>
  • Loading branch information
7 people committed Nov 5, 2021
1 parent eacadf8 commit 953a767
Show file tree
Hide file tree
Showing 216 changed files with 6,005 additions and 40,485 deletions.
263 changes: 0 additions & 263 deletions .circleci/config.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/actions/release-plugin/action.yml
@@ -0,0 +1,22 @@
name: 'WordPress Plugin Deploy'
description: 'Deploy to the WordPress Plugin Repository'
author: '10up'
branding:
icon: 'upload-cloud'
color: 'blue'
inputs:
generate-zip:
description: 'Generate package zip file?'
default: false
outputs:
zip-path:
description: 'Path to zip file'
value: ${{ steps.deploy.outputs.zip-path }}
runs:
using: 'composite'
steps:
- id: deploy
env:
INPUT_GENERATE_ZIP: ${{ inputs.generate-zip }}
run: ${{ github.action_path }}/deploy.sh
shell: bash
108 changes: 108 additions & 0 deletions .github/actions/release-plugin/deploy.sh
@@ -0,0 +1,108 @@
#!/bin/bash

# Note that this does not use pipefail
# because if the grep later doesn't match any deleted files,
# which is likely the majority case,
# it does not exit with a 0, and I only care about the final exit.
set -eo

# Ensure SVN username and password are set
# IMPORTANT: while secrets are encrypted and not viewable in the GitHub UI,
# they are by necessity provided as plaintext in the context of the Action,
# so do not echo or use debug mode unless you want your secrets exposed!
if [[ -z "$SVN_USERNAME" ]]; then
echo "Set the SVN_USERNAME secret"
exit 1
fi

if [[ -z "$SVN_PASSWORD" ]]; then
echo "Set the SVN_PASSWORD secret"
exit 1
fi

# Require the PLUGIN_DIR environment variable to be set
if [[ -z "$PLUGIN_DIR" ]]; then
echo "Set the PLUGIN_DIR environment variable"
exit 1
fi
echo "ℹ︎ PLUGIN_DIR is $PLUGIN_DIR"

# Allow some ENV variables to be customized
if [[ -z "$SLUG" ]]; then
SLUG=${GITHUB_REPOSITORY#*/}
fi
echo "ℹ︎ SLUG is $SLUG"

# Does it even make sense for VERSION to be editable in a workflow definition?
if [[ -z "$VERSION" ]]; then
VERSION="${GITHUB_REF#refs/tags/}"
VERSION="${VERSION#v}"
fi
echo "ℹ︎ VERSION is $VERSION"

if [[ -z "$ASSETS_DIR" ]]; then
ASSETS_DIR=".wordpress-org"
fi
echo "ℹ︎ ASSETS_DIR is $ASSETS_DIR"

SVN_URL="https://plugins.svn.wordpress.org/${SLUG}/"
SVN_DIR="${HOME}/svn-${SLUG}"

# Checkout just trunk and assets for efficiency
# Tagging will be handled on the SVN level
echo "➤ Checking out .org repository..."
svn checkout --depth immediates "$SVN_URL" "$SVN_DIR"
cd "$SVN_DIR"
svn update --set-depth infinity assets
svn update --set-depth infinity trunk

echo "➤ Copying files..."
if [[ -e "$GITHUB_WORKSPACE/$PLUGIN_DIR/.distignore" ]]; then
echo "ℹ︎ Using .distignore"
# Copy from PLUGIN_DIR to /trunk, excluding dotorg assets
# The --delete flag will delete anything in destination that no longer exists in source
rsync -rc --exclude-from="$GITHUB_WORKSPACE/$PLUGIN_DIR/.distignore" "$GITHUB_WORKSPACE/$PLUGIN_DIR" trunk/ --delete --delete-excluded
else
rsync -rc "$GITHUB_WORKSPACE/$PLUGIN_DIR" trunk --delete --delete-excluded
fi

# Copy dotorg assets to /assets
if [[ -d "$GITHUB_WORKSPACE/$PLUGIN_DIR/$ASSETS_DIR/" ]]; then
rsync -rc "$GITHUB_WORKSPACE/$PLUGIN_DIR/$ASSETS_DIR/" assets/ --delete
else
echo "ℹ︎ No assets directory found; skipping asset copy"
fi

# Add everything and commit to SVN
# The force flag ensures we recurse into subdirectories even if they are already added
# Suppress stdout in favor of svn status later for readability
echo "➤ Preparing files..."
svn add . --force > /dev/null

# SVN delete all deleted files
# Also suppress stdout here
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %@ > /dev/null

# Copy tag locally to make this a single commit
echo "➤ Copying tag..."
svn cp "trunk" "tags/$VERSION"

# Fix screenshots getting force downloaded when clicking them
# https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/
svn propset svn:mime-type image/png assets/*.png || true
svn propset svn:mime-type image/jpeg assets/*.jpg || true

svn status

echo "➤ Committing files..."
svn commit -m "Update to version $VERSION from GitHub" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"

if $INPUT_GENERATE_ZIP; then
echo "Generating zip file..."
cd "$SVN_DIR/trunk" || exit
zip -r "${GITHUB_WORKSPACE}/${PLUGIN_DIR}/${SLUG}.zip" .
echo "::set-output name=zip-path::${GITHUB_WORKSPACE}/${PLUGIN_DIR}/${SLUG}.zip"
echo "✓ Zip file generated!"
fi

echo "✓ Plugin deployed!"

1 comment on commit 953a767

@atlas-by-wp-engine
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branch main was deployed successfully
Your environment Production of app faustjs-site was successfully updated
View build logs: https://my.wpengine.com/atlas#/faustjs-site/cwa4v7z4d1u9vi7qw7hythg2/enptfeca9hzzn016xvwf1ap4
View your environment URL: https://faustjs.org

Please sign in to comment.