Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
khleomix committed Aug 23, 2024
1 parent 50522f6 commit 7147bf0
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- [Stylelint Configuration](#stylelint-configuration)
- [Extends](#extends)
- [Accessibility and Code Quality and Security Checks](#accessibility-and-code-quality-and-security-checks)
- [Automated Versioning Process](#automated-versioning-process)
- [Contributing and Support](#contributing-and-support)

</details>
Expand Down Expand Up @@ -539,6 +540,83 @@ WDS BT is equipped with automated workflow actions that ensure code security and

***

## Automated Versioning Process

This theme uses an automated versioning system that increments the `BUILD` number automatically upon merges to the `main` branch. The `VERSION` is manually controlled and is reflected in the `composer.json` and `package.json` files. The `BUILD` number is automatically appended to the `VERSION` in `style.css`.

<details>
<summary><strong>How It Works</strong></summary>

1. **VERSION**: Manually set in the `.env` file. This is reflected in the `composer.json` and `package.json` files.
- Format: `X.Y.Z` (Semantic Versioning)
- This value is manually updated by the developer.

2. **BUILD**: Automatically increments on merges to the `main` branch. This is appended to the `VERSION` in the `style.css` file.
- Format: `1.0.0x` where `x` is the build number.

</details>

<details>
<summary><strong>Example</strong></summary>

Suppose the `.env` file has the following values:

```plaintext
VERSION=1.0.0
BUILD=4
```

After merging a PR into the `main` branch:

- The `BUILD` increments to `5`.
- The version in `style.css` becomes `Version: 1.0.005`.
- The `composer.json` and `package.json` will still reflect `1.0.0`.

</details>

<details>
<summary><strong>Modifying the Version</strong></summary>

- To update the `VERSION`, manually edit the `.env` file:
```plaintext
VERSION=1.1.0
BUILD=0
```
- The `BUILD` should not be manually modified except for specific scenarios, such as resetting the build number after a major version change.

</details>

<details>
<summary><strong>Workflow</strong></summary>

When a PR is merged into the `main` branch, the following occurs automatically:

1. The `BUILD` number increments.
2. The `style.css` is updated to reflect the `VERSION + BUILD`.
3. The `composer.json` and `package.json` files are updated with only the `VERSION`.
4. The updated files are committed back to the `main` branch.

</details>

<details>
<summary><strong>Manual Execution</strong></summary>

You can manually trigger the versioning process locally if necessary by running:

```bash
npm run update-version
```

This will:

- Increment the `BUILD` number.
- Update the version in `style.css`.
- Ensure `composer.json` and `package.json` reflect the correct `VERSION`.

</details>

***

## Contributing and Support

Your contributions and [support tickets](https://github.com/WebDevStudios/wds-bt/issues) are welcome. Please see our [contributing guidelines](https://github.com/WebDevStudios/wds-bt/blob/main/CONTRIBUTING.md) before submitting a pull request.
Expand Down

0 comments on commit 7147bf0

Please sign in to comment.