Skip to content

Commit

Permalink
Merge pull request #67 from actblue/release-v1.3.0
Browse files Browse the repository at this point in the history
Release v1.3.0
  • Loading branch information
samuelcole authored Dec 16, 2020
2 parents b9ce541 + bcab88c commit 424809b
Show file tree
Hide file tree
Showing 18 changed files with 901 additions and 411 deletions.
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

58 changes: 39 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ docker-compose exec wordpress phpunit

## Deployment

The distributed code for this plugin is hosted on the WordPress svn repository and is located at http://plugins.svn.wordpress.org/actblue-contributions/. This GitHub repository comes with two scripts that help facilitate the deployment of the plugin assets and source to that svn repository. The scripts will run as a part of CircleCI's continuous integration, but you can also manually deploy the plugin by running them locally.
The distributed code for this plugin is hosted on the WordPress svn repository and is located at http://plugins.svn.wordpress.org/actblue-contributions/. This GitHub repository comes with a script that helps facilitate the deployment of the plugin assets and source to that svn repository. The script will run as a part of CircleCI's continuous integration, but you can also manually deploy the plugin by running it locally.

### Releasing a new version

Expand All @@ -106,30 +106,47 @@ To release a new version of the plugin via automatic deployment:
1. Create a release branch off of the `develop` branch with the corresponding version number:

```sh
git checkout -b release-#.#.#
git checkout -b release-0.0.0
```

2. Bump the version numbers in the plugin directory:
2. Bump the plugin version:

- `package.json`
- `composer.json`
- Inside the `actblue-contributions.php` file:
- `Version` in the docblock at the top of the file.
- `ACTBLUE_PLUGIN_VERSION` constant.
```sh
./bin/bump-version.sh
```

3. Commit these changes and push to GitHub:

```sh
git add .
git commit -m "Version bump to #.#.#"
git push origin release-#.#.#
git commit -m "Version bump to 0.0.0"
git push origin release-0.0.0
```

4. PR the release branch into the `main` branch via the GitHub GUI. Feel free to add release notes to this PR. Once the checks have passed, merge the PR into `main`.
4. PR the release branch into the `main` branch via the GitHub GUI. Once the checks have passed, merge the PR into `main`.

5. Locally, pull down the latest from `main`, and create a new annotated tag for the new version release. Note that this tag label _must_ have a leading `v` (for example, `v1.0.0`) so that the CircleCI and the deployment scripts can identify it.

```sh
git checkout main
git pull origin main
git tag -a v0.0.0 -m "Release 0.0.0"
```

6. Push the tag to the GitHub repository. ***Note that this action will trigger a deployment to the WordPress svn repository.***

```sh
git push origin --tags
```

5. [Create a new release](https://github.com/actblue/wordpress_plugin/releases/new) in GitHub. Making sure to target the `main` branch, add a tag label that matches the version you're bumping to. Note that this tag label _must_ have a leading `v` (for example, `v1.0.0`) so that the CircleCI and the deployment scripts can identify it. Then add a release title and any release notes and hit `Publish Release`. This will trigger CircleCI to deploy this tagged version of the plugin to the WordPress svn repository with the matching version number.
7. Finally, merge the `main` branch brack into the `develop` branch to align both branches.

<img width="990" alt="Screen Shot 2020-12-03 at 10 02 03 AM" src="https://user-images.githubusercontent.com/3286676/101071232-28ea5100-3551-11eb-8375-048206c32432.png">
```sh
git checkout develop
git pull origin develop
git merge main
git push origin develop
```

### Manual deployment

Expand All @@ -145,16 +162,19 @@ To manually deploy a new version of the plugin from your local machine:

3. Ensure that you have the username and password for the WordPress.org account that has write access to the WordPress svn repository. These credentials can be passed to the script via command line arguments, or be set with the `WP_ORG_USERNAME` and `WP_ORG_PASSWORD` environment variables.

Then run the following scripts:
Then run the following script:

```sh
# Deploy any assets for the plugin listing on WordPress.org:
./.circleci deploy-assets.sh

# Deploy the plugin source:
# Deploy the plugin assets and source files to the WordPress.org repository:
./.circleci deploy-plugin.sh
# Both script also accept command line arguments for the WordPress.org username
# and password if those haven't been set as environment variables.
./.circleci deploy-assets.sh -u actblue -p password
./.circleci deploy-plugin.sh -u actblue -p password
```

There is also a utility script that can be used to _only_ deploy the assets for the WordPress.org plugin listing. This script has the same requirements and can take the same parameters as the `deploy-plugin.sh` script.

```sh
./.circleci deploy-assets.sh
```
4 changes: 2 additions & 2 deletions actblue-contributions/actblue-contributions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: actblue
* Domain Path: /languages
* Version: 1.2.1
* Version: 1.3.0
*/

// If this file is called directly, abort.
Expand All @@ -25,7 +25,7 @@
/**
* Current plugin version.
*/
define( 'ACTBLUE_PLUGIN_VERSION', '1.2.1' );
define( 'ACTBLUE_PLUGIN_VERSION', '1.3.0' );

/**
* Defines the ActBlue host.
Expand Down
18 changes: 16 additions & 2 deletions actblue-contributions/blocks/custom/actblue-button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
TextControl,
withFallbackStyles,
Button,
HorizontalRule,
} from "@wordpress/components";
import {
__experimentalUseGradient,
Expand Down Expand Up @@ -85,7 +86,7 @@ function ActBlueButtonEdit({
setAttributes,
className,
}) {
const { borderRadius, placeholder, text, endpoint } = attributes;
const { borderRadius, placeholder, text, endpoint, refcode } = attributes;

const [isFetching, setIsFetching] = useState(false);
const [fetchMessage, setFetchMessage] = useState("");
Expand All @@ -104,7 +105,6 @@ function ActBlueButtonEdit({
}

setIsFetching(true);
setButtonText("Connecting...");
setFetchMessage("");

const url = `https://secure.actblue.com/cf/oembed?url=${endpoint}&format=json`;
Expand Down Expand Up @@ -174,6 +174,7 @@ function ActBlueButtonEdit({

<Button
isSecondary
isBusy={isFetching}
onClick={handleEndpointSubmit}
disabled={isFetching || !endpoint}
>
Expand All @@ -197,6 +198,19 @@ function ActBlueButtonEdit({
</p>
)}

<HorizontalRule />

<TextControl
label="Refcode"
value={refcode}
onChange={(value) =>
setAttributes({
refcode: value,
})
}
help="Associate contributions made through this button with a refcode."
/>

{/*
We can add a field for an `Amount` with another text control. We can grab the
`amount` variable from the attributes passed to this edit function.
Expand Down
4 changes: 4 additions & 0 deletions actblue-contributions/blocks/custom/actblue-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ const attributes = {
type: "string",
},

refcode: {
type: "string",
},

/**
* Uncommend the following attribute to enable a user to attach a specific donation
* amount to a button. You can then access this `amount` variable in the attributes
Expand Down
7 changes: 5 additions & 2 deletions actblue-contributions/blocks/custom/actblue-button/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ const ActBlueButtonSave = ({ attributes }) => {
backgroundColor,
borderRadius,
customBackgroundColor,
customTextColor,
customGradient,
customTextColor,
endpoint,
gradient,
refcode,
text,
textColor,
title,
token,
endpoint,
} = attributes;

const textClass = getColorClassName("color", textColor);
Expand Down Expand Up @@ -70,6 +71,8 @@ const ActBlueButtonSave = ({ attributes }) => {
value={text}
target="_blank"
data-token={token}
data-refcode={refcode}
rel="noopener noreferrer"
/>
</div>
);
Expand Down
Loading

0 comments on commit 424809b

Please sign in to comment.