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

fix: display correct app version in dhis2 and updated workflows #3182

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

jenniferarnesen
Copy link
Collaborator

PR workflow: verify-pr.yml

  • This workflow triggers on pull request actions only. It verifies that the PR code passes build, lint, test, and e2e.

Release workflow: release.yml

  • This workflow only runs on pushes to the master branch since this is the only release branch. Every release involves 2 commits to master:

squash merging the PR

  • The release workflow pushes a new commit with version change in package.json and CHANGELOG.md, e.g. the [skip release] commit
  • The release workflow triggers for both pushes to master listed above. But we only want the the release job to run for the first push.

The semantic-release workflow steps are found in .releaserc. Previously @dhis2/action-semantic-release was used but this was overkill for our needs and difficult to make changes to. Therefore, we created our own semantic-release steps in .releaserc:

  • commit-analyzer: Determines the next app version
  • release-notes-generator: Generates the new release notes
  • changelog: Updates CHANGELOG.md with the generated release notes
  • npm: Updates package.json with the new version number. Does not publish to npm since private: true in package.json
  • exec: Runs yarn build which updates all version number references in the bundle
  • git: creates commit number "2" (mentioned above) with just CHANGELOG.md and package.json and pushes it to the remote
  • github: pushes the bundle to the github repo as a new release and adds a tag

After semantic-release is complete, the bundle is then published to AppHub so that it is actually available to all users. Because of the addition of the exec yarn build step, all references to the version in the bundle should be the same, thus fixing the annoying bug where the old version displays in the instance after installing the later version.

If any point in the release fails, then a failure message is sent to slack. If the release step succeeds, then a success message is posted to slack that includes the new version number and the release notes.

Publish to d2-ci: publish-to-d2-ci.yml

  • This workflow publishes the build to d2-ci in the following cases:
  • The [skip release] commit on master
  • Git tags

Fail message is sent to slack if the publish failed

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Aug 23, 2024

@dhis2-bot dhis2-bot temporarily deployed to netlify August 23, 2024 11:58 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify August 23, 2024 12:14 Inactive
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
@dhis2-bot dhis2-bot temporarily deployed to netlify August 23, 2024 12:27 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify August 23, 2024 12:42 Inactive
@jenniferarnesen jenniferarnesen merged commit 39f9437 into master Aug 23, 2024
20 checks passed
@jenniferarnesen jenniferarnesen deleted the chore/updated-gh-workflows branch August 23, 2024 13:36
dhis2-bot added a commit that referenced this pull request Aug 26, 2024
## [100.7.1](v100.7.0...v100.7.1) (2024-08-26)

### Bug Fixes

* display correct app version in dhis2 and updated workflows ([#3182](#3182)) ([39f9437](39f9437))
* install dependencies needed to release app with new workflow ([#3183](#3183)) ([f6b2670](f6b2670))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.7.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants