Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix main merge conflict in Deny Public Access Callback #633

Merged
merged 40 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7be3af0
refactor: simplify public route redirection by using template_redirec…
apmatthews Oct 13, 2021
1cf2dd7
Update API Router `import` in Auth Docs (#580)
blakewilson Oct 14, 2021
0f4b31a
chore: remove unused wp-env dependency
apmatthews Oct 18, 2021
9b32758
chore: use Faust WP in comment text
apmatthews Oct 15, 2021
3d09083
chore: set minimum PHP to 7.2
apmatthews Oct 15, 2021
4499fb1
refactor: text domain wpe-headless -> faustwp
apmatthews Oct 15, 2021
b4440dd
refactor: global consts WPE_HEADLESS -> FAUSTWP
apmatthews Oct 15, 2021
b638bd1
refactor: replace function prefixes with namespace
apmatthews Oct 15, 2021
9da2232
refactor: settings slug to faustwp-settings
apmatthews Oct 15, 2021
2aeffb8
refactor: local variable prefixes to faustwp
apmatthews Oct 15, 2021
4ed0d4d
refactor: filter prefixes wpe_headless -> faustwp
apmatthews Oct 15, 2021
ac6c33d
refactor: script handle prefixes to faustwp
apmatthews Oct 15, 2021
708fa7b
refactor: id attribute prefix to faustwp
apmatthews Oct 15, 2021
8085874
refactor: REST API namespace wpac -> faustwp
apmatthews Oct 15, 2021
87a064b
style: phpcs
apmatthews Oct 15, 2021
b3a1ae1
Revert "refactor: REST API namespace wpac -> faustwp"
apmatthews Oct 18, 2021
4bcc43c
chore: add license file and plugin headers
apmatthews Oct 19, 2021
403af39
style: change Faust WP to FaustWP
apmatthews Oct 19, 2021
4a7f147
fix: remove redirect to settings on activation (#595)
apmatthews Oct 19, 2021
9a42ed7
Setup GitHub Actions for Testing/Linting Plugin (#582)
blakewilson Oct 19, 2021
ee88269
chore: update plugin URI (#596)
apmatthews Oct 19, 2021
6274eda
refactor: Remove CircleCI Config (#597)
blakewilson Oct 20, 2021
90ad8b7
Update plugin file and folder name to faustwp (#600)
apmatthews Oct 21, 2021
81d6162
Core refactor (#601)
wjohnsto Oct 21, 2021
7d75c11
Create E2E action (#599)
blakewilson Oct 21, 2021
bbcb08e
fix: headless post previews URL (#602)
blakewilson Oct 21, 2021
44786df
Version Packages (#603)
github-actions[bot] Oct 21, 2021
bb466b8
chore: start unreleased changelog for FaustWP (#604)
apmatthews Oct 22, 2021
4d7f981
chore: Upload test artifact upon failure (#606)
blakewilson Oct 22, 2021
a12f341
Rename settings option to faustwp_settings (#607)
apmatthews Oct 22, 2021
5e0f493
Release `faustwp` plugin action (#608)
blakewilson Oct 25, 2021
603d9b3
fix: e2e plugin npm deps install (#609)
blakewilson Oct 25, 2021
8630834
Next refactor (#605)
wjohnsto Oct 26, 2021
6b8676f
Version Packages (#613)
github-actions[bot] Oct 26, 2021
c55874d
chore: remove react example (#618)
blakewilson Oct 26, 2021
aee4bc5
docs: update tutorial sidebar label (#620)
apmatthews Oct 27, 2021
25e93f4
Grammar Dev Env Setup (#630)
narcher7 Nov 5, 2021
8d9bc5f
Grammar edits to basic headless site (#629)
narcher7 Nov 5, 2021
84ba1b1
Breakout Hooks Docs into Seperate Pages (#632)
blakewilson Nov 5, 2021
9c3c74b
Merge branch 'canary' into fix-main-conflict
blakewilson Nov 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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!"
Loading