From 773ade9a2b9d477a84611c6e8a97645ddcac87c6 Mon Sep 17 00:00:00 2001 From: "samjhecht@gmail.com" Date: Fri, 8 Mar 2024 14:27:50 -0800 Subject: [PATCH 1/4] updating readme to reflect test through version and adding workflow for deploy --- .../build-and-deploy-to-wordpress.yml | 40 +++++++++++++++++++ tako/README.txt | 13 +++++- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-and-deploy-to-wordpress.yml diff --git a/.github/workflows/build-and-deploy-to-wordpress.yml b/.github/workflows/build-and-deploy-to-wordpress.yml new file mode 100644 index 0000000..f7e0614 --- /dev/null +++ b/.github/workflows/build-and-deploy-to-wordpress.yml @@ -0,0 +1,40 @@ +name: Deploy to WordPress.org +on: + push: + branches: + - main # Trigger on push to main branch; adjust if you use a different branch for releases + tags: + - 'v*' # Trigger on version tags, e.g., v1.0.0 + +jobs: + build: + name: Build Plugin Zip + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + + - name: Execute build script + run: | + chmod +x build.sh + ./build.sh + - name: Deploy to WordPress.org + uses: 10up/action-wordpress-plugin-deploy@stable + env: + SVN_USERNAME: ${{ secrets.WORDPRESS_ORG_USERNAME }} + SVN_PASSWORD: ${{ secrets.WORDPRESS_ORG_PASSWORD }} + SLUG: tako-data-visualization # Make sure this matches your plugin's slug on WordPress.org + ASSETS_DIR: .wordpress-org # If you have an assets directory, specify it here + with: + generated-zip-path: tako_plugin.zip + svn-assets-dir: .wordpress-org + + - name: Clean up + if: always() + run: rm -f tako_plugin.zip \ No newline at end of file diff --git a/tako/README.txt b/tako/README.txt index 9538dbd..126db36 100644 --- a/tako/README.txt +++ b/tako/README.txt @@ -2,7 +2,7 @@ Contributors: jintako Tags: data visualization Requires at least: 4.7 -Tested up to: 5.9.3 +Tested up to: 6.4.3 Stable tag: 1.0 Requires PHP: 7.0 License: GPLv3 @@ -19,4 +19,13 @@ Q: Do I need to register on trytako.com to use this plugin? A: Registration is not necessary, but enterprise users will need to login to access themes and other data specific to the enterprise account. -For support or additional questions, please reach out to hello@trytako.com. \ No newline at end of file +For support or additional questions, please reach out to hello@trytako.com. + +== Changelog == + += 1.0 = +- Initial release. Allows embedding of responsive data-driven visualizations from Tako. +- Tested up to WordPress 5.9.3. + += 1.1 = +- Tested on WordPress versions up to 6.4.3. \ No newline at end of file From fb6d343b64374cea552aee6bb4550bce06df85fd Mon Sep 17 00:00:00 2001 From: "samjhecht@gmail.com" Date: Fri, 8 Mar 2024 14:31:26 -0800 Subject: [PATCH 2/4] minor tweak --- .github/workflows/build-and-deploy-to-wordpress.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy-to-wordpress.yml b/.github/workflows/build-and-deploy-to-wordpress.yml index f7e0614..3805f01 100644 --- a/.github/workflows/build-and-deploy-to-wordpress.yml +++ b/.github/workflows/build-and-deploy-to-wordpress.yml @@ -37,4 +37,6 @@ jobs: - name: Clean up if: always() - run: rm -f tako_plugin.zip \ No newline at end of file + run: rm -f tako_plugin.zip + + \ No newline at end of file From e191aee6ba2953fffea94334147296890058d37f Mon Sep 17 00:00:00 2001 From: "samjhecht@gmail.com" Date: Fri, 8 Mar 2024 14:44:33 -0800 Subject: [PATCH 3/4] improving workflow --- .../build-and-deploy-to-wordpress.yml | 99 +++++++++++++------ 1 file changed, 68 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build-and-deploy-to-wordpress.yml b/.github/workflows/build-and-deploy-to-wordpress.yml index 3805f01..f60fbdd 100644 --- a/.github/workflows/build-and-deploy-to-wordpress.yml +++ b/.github/workflows/build-and-deploy-to-wordpress.yml @@ -1,42 +1,79 @@ name: Deploy to WordPress.org + on: push: branches: - - main # Trigger on push to main branch; adjust if you use a different branch for releases + - main # Trigger on push to main branch tags: - 'v*' # Trigger on version tags, e.g., v1.0.0 jobs: - build: - name: Build Plugin Zip + deploy_to_wp_repository: + + # The proper name for the job being run. + name: Deploy to WP.org + runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Execute build script - run: | - chmod +x build.sh - ./build.sh - - name: Deploy to WordPress.org - uses: 10up/action-wordpress-plugin-deploy@stable - env: - SVN_USERNAME: ${{ secrets.WORDPRESS_ORG_USERNAME }} - SVN_PASSWORD: ${{ secrets.WORDPRESS_ORG_PASSWORD }} - SLUG: tako-data-visualization # Make sure this matches your plugin's slug on WordPress.org - ASSETS_DIR: .wordpress-org # If you have an assets directory, specify it here - with: - generated-zip-path: tako_plugin.zip - svn-assets-dir: .wordpress-org - - - name: Clean up - if: always() - run: rm -f tako_plugin.zip - - \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + + - name: Execute build script + run: | + chmod +x build.sh + ./build.sh + - name: WordPress Plugin Deploy + + # You can add unique ids to specific steps if you want to reference their output later in the workflow. + # + # Here, this unique identifier lets us use the output from the action to get the zip-path later. + id: deploy + + # The use statement lets us pull in the work done by 10up to deploy the plugin to the WordPress repository. + uses: 10up/action-wordpress-plugin-deploy@stable + + # Steps can also provide arguments, so this configures 10up's action to also generate a zip file. + with: + generate-zip: true + + # Steps can also set environment variables which can be configured in the Github settings for the + # repository. Here, we are using action secrets SVN_USERNAME, SVN_PASSWORD, and PLUGIN_SLUG which + # authenticate with WordPress and lets the action deploy our plugin to the repository. + # + # To learn more about setting and using secrets with Github Actions, check out: https://docs.github.com/en/actions/security-guides/encrypted-secrets?tool=webui#about-encrypted-secrets + env: + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + + # After the deploy, we also want to create a zip and upload it to the release on Github. We don't want + # users to have to go to the repository to find our plugin :). + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + # Note, this is an exception to action secrets: GH_TOKEN is always available and provides access to + # the current repository this action runs in. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + with: + # Get the URL for uploading assets to the current release. + upload_url: ${{ github.event.release.upload_url }} + + # Provide the path to the file generated in the previous step using the output. + asset_path: ${{ steps.deploy.outputs.zip-path }} + + # Provide what the file should be named when attached to the release (plugin-name.zip) + asset_name: tako-data-visualization.zip + + # Provide the file type. + asset_content_type: application/zip + + - name: Clean up + if: always() + run: rm -f tako_plugin.zip + From dcb4265e668d300b3e31702791894554e057e7d5 Mon Sep 17 00:00:00 2001 From: "samjhecht@gmail.com" Date: Fri, 8 Mar 2024 14:47:23 -0800 Subject: [PATCH 4/4] adding docs --- .github/workflows/build-and-deploy-to-wordpress.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-deploy-to-wordpress.yml b/.github/workflows/build-and-deploy-to-wordpress.yml index f60fbdd..9786c1a 100644 --- a/.github/workflows/build-and-deploy-to-wordpress.yml +++ b/.github/workflows/build-and-deploy-to-wordpress.yml @@ -1,5 +1,7 @@ name: Deploy to WordPress.org +# Useful documentation on the 10up example we base this off: https://github.com/10up/action-wordpress-plugin-deploy/blob/develop/README.md + on: push: branches: