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

Create GitHub Actions workflow for automatic publishing #44

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Jan 23, 2024

Part of #40

Closes #39

Add a new GitHub actions workflow that triggers for every new release, and publishes the plugin to wordpress.org using https://github.com/10up/action-wordpress-plugin-deploy. This seems to be the de-facto GitHub Action to publish WordPress plugins.

Additionally, remove the custom scripts previously used for building and publishing.

TODO

  • Make sure secrets are set

@acelaya acelaya force-pushed the publish-workflow branch 2 times, most recently from f148bda to 984a069 Compare January 23, 2024 13:50
@acelaya acelaya mentioned this pull request Jan 23, 2024
@acelaya acelaya changed the title Create GitHub actions workflow for automatic publishing Create GitHub Actions workflow for automatic publishing Jan 23, 2024
@@ -1,6 +1,6 @@
{
"name": "hypothesis",
"version": "0.4.8",
"version": "0.6.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was outdated, but it's not really used at the moment.

uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_USERNAME: ${{ secrets.WP_SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.WP_SVN_PASSWORD }}
Copy link
Contributor Author

@acelaya acelaya Jan 24, 2024

Choose a reason for hiding this comment

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

The secrets have been set

image

@acelaya acelaya marked this pull request as ready for review January 24, 2024 13:13
@@ -4,7 +4,7 @@
* Plugin URI: https://hypothes.is/
* Description: Hypothesis is an open platform for the collaborative evaluation of knowledge. This plugin embeds the necessary scripts in your WordPress site to enable any user to use Hypothesis without installing any extensions.
* Version: 0.6.0
* Requires at least: 6.0
* Requires at least: 6.2
Copy link
Contributor Author

@acelaya acelaya Jan 24, 2024

Choose a reason for hiding this comment

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

As far as I can see, many popular plugins support the latest 3 minor versions, which are 6.2, 6.3 and 6.4

README.md Outdated
Comment on lines 16 to 28
Follow these steps to publish a new plugin version.

1. **Update the package version** in `hypothesis.php`, `readme.txt` and `package.json`, and merge that change into the `main` branch[^1]. We use [Semantic Versioning](https://semver.org/#semantic-versioning-200).
2. **Create a tag** pointing at the version-change commit and generate a **new GitHub release** (details follow). Publishing a GitHub release will kick off a GitHub Action that will publish the plugin to wordpress.org

### Creating a GitHub release

Create a [new GitHub release](https://github.com/hypothesis/frontend-shared/releases/new/) with these values:

1. _Tag_: Create a new tag for the release, targeting the `main` branch (your just-merged version bump should be at the tip)[^2]. The tag should match the version number, e.g. `v5.2.1`.
2. _Title_: Use the tag name.
3. Click the `Auto-generate release notes` button to generate release notes and edit as needed. We use [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) formatting.[^3]
4. Leave other fields alone/as defaults.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took this from frontend-shared. The only difference is that the version needs to be edited in hypothesis.php and readme.txt.

README.md Outdated Show resolved Hide resolved
Copy link
Member

@marcospri marcospri left a comment

Choose a reason for hiding this comment

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

Not much to say, looks good 👍

@acelaya acelaya merged commit 4027f57 into main Jan 25, 2024
6 checks passed
@acelaya acelaya deleted the publish-workflow branch January 25, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate publishing via GitHub actions
2 participants