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

10up GitHub deploy #2647

Merged
merged 6 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/.git
/.github
/node_modules
.gitignore
/.wordpress-org-readme
.*
*.lock
*.xml
*.xml.dist
*.config.js
CHANGELOG.md
composer.json
docker-compose.yml
lerna.json
package.json
package-lock.json
README.md
/assets/scss
_private
/dist
/docs
gulpfile.js
/node_modules
/packages
/src
/tests
/tmp
/wordpress
/libraries/README.md
/libraries/**/composer.*
/libraries/**/i18n
/vendor/bin
/vendor/**/**/composer.*
/vendor/**/**/*.md
/vendor/**/**/.*
/vendor/composer/installers
/vendor/composer/lifters
102 changes: 102 additions & 0 deletions .github/workflows/release-svn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# The name of the Github Action that displays in github.com/<username>/<repo>/actions
name: Deploy to WordPress.org Repository

# Here we can define the events "on" which the action should be triggered.
on:

# Since we want to publish new versions of our plugin, we only want this action to
# run when publishing a new release.
#
# The released version of the plugin will then be deployed to the repository.
#
# This allows us to run and manage plugin releases from a single location.
release:

# run only when a new release is published, but not when it's classified as a pre-release.
types: [released]

# A list of jobs involved in this workflow.
jobs:

# A unique job identifier.
#
# Github Actions can have multiple jobs and each can be referenced by its name.
# However, we only need to run a few steps here and they can be handled in a single job.
deploy_to_wp_repository:

# The proper name for the job being run.
name: Deploy to WP.org

# The environment this job should run on. In the context of WordPress, ubuntu-latest is
# pretty typical. Since we are only interacting with git and subversion, Ubuntu is perfect
# for this.
#
# Github does offer other platforms if you need them: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-latest

# Every job has a specific set of steps that it goes through to do its "work".
#
# Each step has a two key elements:
# • Name
# • a "run" command (an arbitrary CLI command to execute) OR a "uses" command that pulls in and executes a 3rd party action.
steps:

# Most workflows begin by checking out the repository into the workflow filesystem.
#
# This is just like cloning a repository except it only checks out the specific commit
# the job is executed for. In our case here, the commit that the release is attached to.
- name: Checkout code
uses: actions/checkout@v2

# Optional: If your plugin is using composer dependencies, we want to include them
# WITHOUT the dev dependencies.
# - name: Build
# run: |
# npm ci
# npm run build
# composer install -o --no-dev
- 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: false

# 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)
# # TODO: Version number on the zip name, which is the tag?
# asset_name: ${{ github.event.repository.name }}.zip
#
# # Provide the file type.
# asset_content_type: application/zip
File renamed without changes.
File renamed without changes
1 change: 0 additions & 1 deletion class-lifterlms.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @package LifterLMS/Main
*
* @since 1.0.0
* @version 7.2.0
*/

defined( 'ABSPATH' ) || exit;
Expand Down
6 changes: 3 additions & 3 deletions .wordpress-org/README.md → docs/wordpress-org.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This directory contains the text content and assets used on the LifterLMS plugin

## README

The [readme](./readme) directory contains the markdown files representing the sections (and tabs) used on the listing.
The [.wordpress-org-readme](../.wordpress-org-readme) directory contains the markdown files representing the sections (and tabs) used on the listing.

These files are combined during a build step prior distribution and output as the [readme.txt](../readme.txt) file distributed with the LifterLMS plugin. Generally we do not ship updates for changes to the readme directory. These changes will be included in the next release which contains code changes.

Expand All @@ -28,8 +28,8 @@ Various merge codes are available for use in the readme file parts. See the [@li

## Assets

The [assets](./assets) directory contains the images used in the listing: banners, icons, and screenshots.
The [.wordpress-org](../.wordpress-org) directory contains the images used in the listing: banners, icons, and screenshots.

See also: [How Your Plugin Assets Work](https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/).

Assets are manually synced to WordPress.org via SVN @thomasplevy and will be updated in conjunction with the next release following their update in this directory.
Assets are updated via the 10up Github action during a release. See the release-svn.md for more information.
4 changes: 2 additions & 2 deletions packages/dev/src/cmds/readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Merge codes:
*
* @since 0.0.1
* @since 0.1.0 Added the `--main-file` option as well as additional merge codes derived from metadata found in the main file's header comment.
* Exits with a warning and exit code `0` (instead of an error and exit code `1`) when running this command against a prerelease.
* Exits with a warning and exit code `0` (instead of an error and exit code `1`) when running this command against a prerelease.
*
* @type {Object}
*/
Expand All @@ -89,7 +89,7 @@ module.exports = {
[ '-o, --output-file <filename>', 'Specify the output readme file name.', 'readme.txt' ],
[ '-i, --input-file <filename>', 'Specify the input changelog file name.', 'CHANGELOG.md' ],
[ '-m, --main-file <filename>', 'Specify the project main file name where metadata is stored.', `${ getProjectSlug() }.php` ],
[ '-d, --dir <directory>', 'Directory where the readme part files are stored', '.wordpress-org/readme' ],
[ '-d, --dir <directory>', 'Directory where the readme part files are stored', '.wordpress-org-readme' ],
[ '-l, --changelog-length <number>', 'Specify the number of versions to display before truncating the changelog.', 10 ],
[ '-r, --read-more <url>', 'Specify the "Read More" url where changelogs are published.', `https://make.lifterlms.com/tag/${ getProjectSlug() }` ],
],
Expand Down
Loading