The IFRC Go web application deployment occurs across nightly, staging, and production instances via Azure Pipelines. The environment variables must be properly configured for the deployment workflow to run smoothly.
We use changesets to manage versioning and generate changelogs for each release. The version must be updated with each release, and the deployment is carried out through the develop
branch.
changesets is used to manage versioning and changelogs across different packages within IFRC GO.
- New Features: When you add new functionality that users can interact with. This requires version bumping to signal a feature addition.
- Bug Fixes: For resolving issues that affect existing functionality, ensuring a version bump and clear changelog entries.
- Breaking Changes: When changes may disrupt existing workflows or integrations, reflecting this with a major version increment.
changesets isn't required for internal-only updates, minor refactoring, or documentation changes that don't impact functionality.
In the IFRC GO project, we follow SemVer (Semantic Versioning) to maintain consistency and clarity. Here's a quick guide to determine whether your changes should be categorized as a patch, minor, or major version update
-
Patch Version (x.y.patch)
- Bug fixes, small tweaks, or performance improvements.
-
Minor Version (x.minor.z)
- Adding new features.
-
Major Version (major.y.z)
- Introducing breaking changes or significant new features.
Tip
When in doubt, favor patch or minor updates to avoid unnecessary major releases.
-
Ensure all changes have been merged into the
develop
branch. -
Fetch and checkout the latest
develop
branchgit fetch git checkout develop git pull --rebase
-
Verify that changesets have been created.
-
Update the version by running
pnpm changeset version
This command consumes all changesets and updates the version according to semantic versioning. It also writes changelog entries for each consumed changeset. Review the changelog entries and version changes for packages. Make any necessary adjustments to the changelogs.
-
Commit the changes with the new version number as the commit message
git commit -m "v{go-web-app-version-number}"
-
Push the commit to the origin
git push origin develop
Important
Make sure you have the necessary permissions to push to the develop branch. If you don't have the credentials, push to a different branch and send a PR targeting the develop branch.
- Generate a git tag for the current version of all packages
pnpm changeset tag
Important
Ensure all existing tags are fetched from the remote repository before generating new tags with pnpm changeset tag
. This can be done using git fetch --tags
to ensure you have the latest tags in your local repository, which helps avoid potential conflicts or issues with tag generation.
- Push the generated tags to the origin
git push --follow-tags
TODO Add azure pipelines deployment documentation
To release the IFRC Go UI to NPM using changesets, follow these steps. Ensure you have the necessary credentials and publishing rights to the ifrc-go/ui package.
-
Ensure Changes Are Merged
- Make sure all changes have been merged into the
develop
branch.
- Make sure all changes have been merged into the
-
Checkout
develop
Branchgit checkout develop
-
Verify Changesets
- Confirm that changesets have been created.
-
Update the Version
pnpm changeset version
-
Commit Version Update
git commit -m "v{go-web-app-version-number}"
-
Push Commit to Origin
git push origin develop
Note
Ensure you have the necessary permissions to push to the develop
branch. If not, push to a different branch and create a PR targeting the develop
branch.
- Login to NPM
npm login
Note
Ensure you have the appropriate rights to publish the package.
- Publish the Package
pnpm changeset publish
- Push Tags to origin
git push --follow-tags
The Go UI Storybook is deployed to Chromatic using the Publish to Chromatic GitHub action. This action is configured to detect changes in the packages/ui
or packages/go-ui-storybook
directories and deploy only when modifications are found.
The Storybook can be accessed here.