From db7e8a571965dde6656e786cb38dba985df80190 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 22 Mar 2023 15:59:39 +0530 Subject: [PATCH 01/11] Add GHA for deploy standalone plugins --- .../workflows/deploy-standalone-plugins.yml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/deploy-standalone-plugins.yml diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml new file mode 100644 index 0000000000..c324cb8244 --- /dev/null +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -0,0 +1,59 @@ +name: Deploy standalone plugins to WordPress.org + +on: + push: + branches: + - trunk + - 'release/**' + paths: + - '.github/workflows/deploy-standalone-plugins.yml' + pull_request: + branches: + - trunk + - 'release/**' + - 'feature/**' + paths: + - '.github/workflows/deploy-standalone-plugins.yml' + types: + - opened + - reopened + - synchronize + +jobs: + release: + name: New Release + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v3 + - id: set-matrix + run: echo "matrix="$(jq -c '{include:[keys[] as $k | {name:$k,slug:.[$k].slug,version:.[$k].version }]}' plugins.json) >> $GITHUB_OUTPUT + - uses: actions/checkout@v3 + - name: Setup Node.js (.nvmrc) + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: npm + - name: npm install + run: npm ci + - name: Building standalone plugins + id: build-plugins + run: npm run build-plugins + deploy: + needs: release + runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJSON(needs.release.outputs.matrix) }} + steps: + - uses: actions/checkout@v3 + - name: Deploy Standalone Plugin - ${{ matrix.slug }} + uses: 10up/action-wordpress-plugin-deploy@stable + env: + #SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + #SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SVN_PASSWORD: SVN_PASSWORD + SVN_USERNAME: SVN_USERNAME + SLUG: ${{ matrix.slug }} + VERSION: ${{ matrix.version }} + BUILD_DIR: ./build/${{ matrix.slug }} From 4eb793bc9d4eb20f1202068250e52212b42a0fc6 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Fri, 24 Mar 2023 15:13:20 +0530 Subject: [PATCH 02/11] Address review feedback --- .../workflows/deploy-standalone-plugins.yml | 15 +- deploy.sh | 170 ++++++++++++++++++ 2 files changed, 180 insertions(+), 5 deletions(-) create mode 100644 deploy.sh diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml index c324cb8244..78a2545447 100644 --- a/.github/workflows/deploy-standalone-plugins.yml +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -26,16 +26,19 @@ jobs: outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set matrix - id: set-matrix + # Load the JSON file and parse from "{name: {slug, version}, ...}" to "include: [{ name, slug, version }, ...]" + # for use in the matrix. run: echo "matrix="$(jq -c '{include:[keys[] as $k | {name:$k,slug:.[$k].slug,version:.[$k].version }]}' plugins.json) >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 - name: Setup Node.js (.nvmrc) uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' cache: npm - - name: npm install + - name: Install npm dependencies run: npm ci - name: Building standalone plugins id: build-plugins @@ -46,9 +49,10 @@ jobs: strategy: matrix: ${{ fromJSON(needs.release.outputs.matrix) }} steps: - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - name: Deploy Standalone Plugin - ${{ matrix.slug }} - uses: 10up/action-wordpress-plugin-deploy@stable + #uses: 10up/action-wordpress-plugin-deploy@stable env: #SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} #SVN_USERNAME: ${{ secrets.SVN_USERNAME }} @@ -57,3 +61,4 @@ jobs: SLUG: ${{ matrix.slug }} VERSION: ${{ matrix.version }} BUILD_DIR: ./build/${{ matrix.slug }} + run: bash ./deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000000..5d10d62e76 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,170 @@ +#!/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 + +# 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" + +if [[ -z "$BUILD_DIR" ]] || [[ $BUILD_DIR == "./" ]]; then + BUILD_DIR=false +elif [[ $BUILD_DIR == ./* ]]; then + BUILD_DIR=${BUILD_DIR:2} +fi + +if [[ "$BUILD_DIR" != false ]]; then + if [[ $BUILD_DIR != /* ]]; then + BUILD_DIR="${GITHUB_WORKSPACE%/}/${BUILD_DIR%/}" + fi + echo "ℹ︎ BUILD_DIR is $BUILD_DIR" +fi + +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 + + +if [[ "$BUILD_DIR" = false ]]; then + echo "➤ Copying files..." + if [[ -e "$GITHUB_WORKSPACE/.distignore" ]]; then + echo "ℹ︎ Using .distignore" + # Copy from current branch 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/.distignore" "$GITHUB_WORKSPACE/" trunk/ --delete --delete-excluded + else + echo "ℹ︎ Using .gitattributes" + + cd "$GITHUB_WORKSPACE" + + # "Export" a cleaned copy to a temp directory + TMP_DIR="${HOME}/archivetmp" + mkdir "$TMP_DIR" + + git config --global user.email "10upbot+github@10up.com" + git config --global user.name "10upbot on GitHub" + + # If there's no .gitattributes file, write a default one into place + if [[ ! -e "$GITHUB_WORKSPACE/.gitattributes" ]]; then + cat > "$GITHUB_WORKSPACE/.gitattributes" <<-EOL + /$ASSETS_DIR export-ignore + /.gitattributes export-ignore + /.gitignore export-ignore + /.github export-ignore + EOL + + # Ensure we are in the $GITHUB_WORKSPACE directory, just in case + # The .gitattributes file has to be committed to be used + # Just don't push it to the origin repo :) + git add .gitattributes && git commit -m "Add .gitattributes file" + fi + + # This will exclude everything in the .gitattributes file with the export-ignore flag + git archive HEAD | tar x --directory="$TMP_DIR" + + cd "$SVN_DIR" + + # Copy from clean copy to /trunk, excluding dotorg assets + # The --delete flag will delete anything in destination that no longer exists in source + rsync -rc "$TMP_DIR/" trunk/ --delete --delete-excluded + fi +else + echo "ℹ︎ Copying files from build directory..." + rsync -rc "$BUILD_DIR/" trunk/ --delete --delete-excluded +fi + +# Copy dotorg assets to /assets +if [[ -d "$GITHUB_WORKSPACE/$ASSETS_DIR/" ]]; then + rsync -rc "$GITHUB_WORKSPACE/$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/ +if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.png" -print -quit)"; then + svn propset svn:mime-type "image/png" "$SVN_DIR/assets/"*.png || true +fi +if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.jpg" -print -quit)"; then + svn propset svn:mime-type "image/jpeg" "$SVN_DIR/assets/"*.jpg || true +fi +if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.gif" -print -quit)"; then + svn propset svn:mime-type "image/gif" "$SVN_DIR/assets/"*.gif || true +fi +if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.svg" -print -quit)"; then + svn propset svn:mime-type "image/svg+xml" "$SVN_DIR/assets/"*.svg || true +fi + +#Resolves => SVN commit failed: Directory out of date +svn update + +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..." + + # use a symbolic link so the directory in the zip matches the slug +# ln -s "${SVN_DIR}/trunk" "${SVN_DIR}/${SLUG}" +# zip -r "${GITHUB_WORKSPACE}/${SLUG}.zip" "$SLUG" +# unlink "${SVN_DIR}/${SLUG}" + +# echo "zip-path=${GITHUB_WORKSPACE}/${SLUG}.zip" >> "${GITHUB_OUTPUT}" +# echo "✓ Zip file generated!" +#fi + +echo "✓ Plugin deployed!" \ No newline at end of file From a63c123ee4120e3a49c9bc5c5a50712004842c8e Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Fri, 24 Mar 2023 19:29:40 +0530 Subject: [PATCH 03/11] Update workflow steps --- .../workflows/deploy-standalone-plugins.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml index 78a2545447..abb3208971 100644 --- a/.github/workflows/deploy-standalone-plugins.yml +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -29,10 +29,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Set matrix - - id: set-matrix + id: set-matrix # Load the JSON file and parse from "{name: {slug, version}, ...}" to "include: [{ name, slug, version }, ...]" # for use in the matrix. run: echo "matrix="$(jq -c '{include:[keys[] as $k | {name:$k,slug:.[$k].slug,version:.[$k].version }]}' plugins.json) >> $GITHUB_OUTPUT + deploy: + needs: release + runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJSON(needs.release.outputs.matrix) }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 - name: Setup Node.js (.nvmrc) uses: actions/setup-node@v3 with: @@ -41,16 +49,7 @@ jobs: - name: Install npm dependencies run: npm ci - name: Building standalone plugins - id: build-plugins run: npm run build-plugins - deploy: - needs: release - runs-on: ubuntu-latest - strategy: - matrix: ${{ fromJSON(needs.release.outputs.matrix) }} - steps: - - name: Checkout repository - uses: actions/checkout@v3 - name: Deploy Standalone Plugin - ${{ matrix.slug }} #uses: 10up/action-wordpress-plugin-deploy@stable env: From 5d720c61cfa7b3881c4d0d7c0f80afd40c950b52 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 27 Mar 2023 09:28:19 +0530 Subject: [PATCH 04/11] Add newline at end of file --- deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 5d10d62e76..7c58ccab6b 100644 --- a/deploy.sh +++ b/deploy.sh @@ -167,4 +167,4 @@ svn status # echo "✓ Zip file generated!" #fi -echo "✓ Plugin deployed!" \ No newline at end of file +echo "✓ Plugin deployed!" From a05f8699085671b1cbc6c5cb92b35ea9286969cf Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Sat, 1 Apr 2023 16:17:53 +0530 Subject: [PATCH 05/11] Minor change --- .github/workflows/deploy-standalone-plugins.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml index abb3208971..fd04808630 100644 --- a/.github/workflows/deploy-standalone-plugins.yml +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -51,10 +51,10 @@ jobs: - name: Building standalone plugins run: npm run build-plugins - name: Deploy Standalone Plugin - ${{ matrix.slug }} - #uses: 10up/action-wordpress-plugin-deploy@stable + # uses: 10up/action-wordpress-plugin-deploy@stable env: - #SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} - #SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + # SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + # SVN_USERNAME: ${{ secrets.SVN_USERNAME }} SVN_PASSWORD: SVN_PASSWORD SVN_USERNAME: SVN_USERNAME SLUG: ${{ matrix.slug }} From a2c11d3d5e5a969d0b6b617cd37bc20490c89171 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Sat, 1 Apr 2023 16:30:30 +0530 Subject: [PATCH 06/11] uncomment code --- .github/workflows/deploy-standalone-plugins.yml | 6 +++--- deploy.sh | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml index fd04808630..abb3208971 100644 --- a/.github/workflows/deploy-standalone-plugins.yml +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -51,10 +51,10 @@ jobs: - name: Building standalone plugins run: npm run build-plugins - name: Deploy Standalone Plugin - ${{ matrix.slug }} - # uses: 10up/action-wordpress-plugin-deploy@stable + #uses: 10up/action-wordpress-plugin-deploy@stable env: - # SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} - # SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + #SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + #SVN_USERNAME: ${{ secrets.SVN_USERNAME }} SVN_PASSWORD: SVN_PASSWORD SVN_USERNAME: SVN_USERNAME SLUG: ${{ matrix.slug }} diff --git a/deploy.sh b/deploy.sh index 7c58ccab6b..36afbfc2fe 100644 --- a/deploy.sh +++ b/deploy.sh @@ -56,11 +56,11 @@ 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 "➤ 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 if [[ "$BUILD_DIR" = false ]]; then From 5d4e5c070db2784410fbe0f5fb30481490bca9ee Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 4 Apr 2023 10:34:51 +0530 Subject: [PATCH 07/11] Add ASSETS_DIR for plugin --- .github/workflows/deploy-standalone-plugins.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml index abb3208971..f1cf081425 100644 --- a/.github/workflows/deploy-standalone-plugins.yml +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -60,4 +60,5 @@ jobs: SLUG: ${{ matrix.slug }} VERSION: ${{ matrix.version }} BUILD_DIR: ./build/${{ matrix.slug }} + ASSETS_DIR: ./build/${{ matrix.slug }}/.wordpress-org run: bash ./deploy.sh From 91b45e07a08a508a349b894fceaafbb5918221cd Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 4 Apr 2023 18:20:19 +0530 Subject: [PATCH 08/11] TODO comment added --- .../workflows/deploy-standalone-plugins.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml index f1cf081425..fe31a52d7a 100644 --- a/.github/workflows/deploy-standalone-plugins.yml +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -1,12 +1,7 @@ name: Deploy standalone plugins to WordPress.org on: - push: - branches: - - trunk - - 'release/**' - paths: - - '.github/workflows/deploy-standalone-plugins.yml' + # TODO The pull_request will be removed once the workflow is tested. pull_request: branches: - trunk @@ -18,6 +13,13 @@ on: - opened - reopened - synchronize + release: + types: [published] + workflow_dispatch: + inputs: + slug: + type: string + description: 'The slug of the plugin to deploy' jobs: release: @@ -51,14 +53,18 @@ jobs: - name: Building standalone plugins run: npm run build-plugins - name: Deploy Standalone Plugin - ${{ matrix.slug }} + # TODO Once the workflow is tested, we will remove the comment and use the 10up action to deploy the plugin. #uses: 10up/action-wordpress-plugin-deploy@stable env: + # TODO Once the workflow is tested, we will remove the comment and use the secret SVN access. #SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} #SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + # TODO Once the workflow is tested, we will remove this test credential. SVN_PASSWORD: SVN_PASSWORD SVN_USERNAME: SVN_USERNAME SLUG: ${{ matrix.slug }} VERSION: ${{ matrix.version }} BUILD_DIR: ./build/${{ matrix.slug }} ASSETS_DIR: ./build/${{ matrix.slug }}/.wordpress-org + # TODO The script will be removed once the workflow is tested. run: bash ./deploy.sh From 748df3b0f66ad2f7d770043ab6444096dc186d95 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 5 Apr 2023 12:16:26 +0530 Subject: [PATCH 09/11] Add manual workflow related changes --- .github/workflows/deploy-standalone-plugins.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml index fe31a52d7a..c7c3a379ec 100644 --- a/.github/workflows/deploy-standalone-plugins.yml +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -20,6 +20,9 @@ on: slug: type: string description: 'The slug of the plugin to deploy' + version: + type: string + description: 'The version of the plugin to deploy' jobs: release: @@ -32,9 +35,15 @@ jobs: uses: actions/checkout@v3 - name: Set matrix id: set-matrix - # Load the JSON file and parse from "{name: {slug, version}, ...}" to "include: [{ name, slug, version }, ...]" - # for use in the matrix. - run: echo "matrix="$(jq -c '{include:[keys[] as $k | {name:$k,slug:.[$k].slug,version:.[$k].version }]}' plugins.json) >> $GITHUB_OUTPUT + run: | + if ${{ github.event_name == 'workflow_dispatch' }}; then + # Set the manual input values in JSON format for use in the matrix. + echo "matrix={\"include\":[{\"slug\":\"${{ inputs.slug }}\",\"version\":\"${{ inputs.version }}\"}]}" >> $GITHUB_OUTPUT + else + # Load the JSON file and parse from "{name: {slug, version}, ...}" to "include: [{ name, slug, version }, ...]" + # for use in the matrix. + echo "matrix="$(jq -c '{include:[keys[] as $k | {name:$k,slug:.[$k].slug,version:.[$k].version }]}' plugins.json) >> $GITHUB_OUTPUT + fi deploy: needs: release runs-on: ubuntu-latest From d315bda0cac856b3c900654dffb4a03a9505f543 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 5 Apr 2023 21:47:53 +0530 Subject: [PATCH 10/11] Remove comment for generating zip code --- deploy.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy.sh b/deploy.sh index 36afbfc2fe..116a0c5c9e 100644 --- a/deploy.sh +++ b/deploy.sh @@ -155,16 +155,16 @@ 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..." +if $INPUT_GENERATE_ZIP; then + echo "Generating zip file..." # use a symbolic link so the directory in the zip matches the slug -# ln -s "${SVN_DIR}/trunk" "${SVN_DIR}/${SLUG}" -# zip -r "${GITHUB_WORKSPACE}/${SLUG}.zip" "$SLUG" -# unlink "${SVN_DIR}/${SLUG}" + ln -s "${SVN_DIR}/trunk" "${SVN_DIR}/${SLUG}" + zip -r "${GITHUB_WORKSPACE}/${SLUG}.zip" "$SLUG" + unlink "${SVN_DIR}/${SLUG}" -# echo "zip-path=${GITHUB_WORKSPACE}/${SLUG}.zip" >> "${GITHUB_OUTPUT}" -# echo "✓ Zip file generated!" -#fi + echo "zip-path=${GITHUB_WORKSPACE}/${SLUG}.zip" >> "${GITHUB_OUTPUT}" + echo "✓ Zip file generated!" +fi echo "✓ Plugin deployed!" From 511eac7b294006e380b1959b4b75495ee700f6fa Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 5 Apr 2023 22:04:11 +0530 Subject: [PATCH 11/11] Remove pull_request trigger Co-authored-by: Felix Arntz --- .github/workflows/deploy-standalone-plugins.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/deploy-standalone-plugins.yml b/.github/workflows/deploy-standalone-plugins.yml index c7c3a379ec..18ed0a8f99 100644 --- a/.github/workflows/deploy-standalone-plugins.yml +++ b/.github/workflows/deploy-standalone-plugins.yml @@ -1,18 +1,6 @@ name: Deploy standalone plugins to WordPress.org on: - # TODO The pull_request will be removed once the workflow is tested. - pull_request: - branches: - - trunk - - 'release/**' - - 'feature/**' - paths: - - '.github/workflows/deploy-standalone-plugins.yml' - types: - - opened - - reopened - - synchronize release: types: [published] workflow_dispatch: