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

chore: update workflows for release and version bump #8

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

TheRealAmazonKendra
Copy link
Contributor

What's Changed:

  1. Running yarn build will now automatically update the schema if any changes have been made that will impact it. Not all changes will. This is accomplished by adding the existing command yarn update-schema into the pre-compile step that is run within yarn build. It is also run in the release step to check for any unintentional changes and will fail the release if uncommitted changes are found (one intentional exception is listed below).
  2. A new function bump() will check for any updates to the schema (generated by pre-compile). If there are any, it will update the minimum major version to release by a full major version based off the latest tag in the repository. If there are no changes to the schema, no updates will be made. This is accomplished by setting bump() as the value for minMajorVersion. If there are no changes to the schema, this field will remain undefined but if there are, it will increment the version. This change will not be committed and will be removed once the release has completed, similarly to how unbump works in projen
  3. A new command yarn pre-release runs update-schema and default. Running default after update-schema accomplishes all of the above and re-synthesizes the tasks.json file with the new major version so that the release command will run on the updated task definition.

Any uncommitted changes other than the minMajorVersion update will cause the release command to fail.

@TheRealAmazonKendra TheRealAmazonKendra force-pushed the TheRealAmazonKendra/release-workflow branch from 2ecb07d to 8674491 Compare August 2, 2024 01:43
Copy link
Contributor

@scanlonp scanlonp left a comment

Choose a reason for hiding this comment

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

Good to approve, but have 1 question about the version.json file. I see we are deleting it, and using the github release tags as the source of truth for the major version. Why do we still need to write that file when running bump?

const oldVersion = metadata.version;
const newVersion = semver.inc(oldVersion, 'major');
const newVersion = schemasChanged() ? semver.inc(oldVersion, 'major')! : oldVersion;
const versionFile = path.join(SCHEMA_DIR, 'cloud-assembly.version.json');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to persist this version.json file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pre-release testing purposes only. It will be deleted before I do the first release.

@mergify mergify bot merged commit 39892ad into main Aug 5, 2024
12 checks passed
@mergify mergify bot deleted the TheRealAmazonKendra/release-workflow branch August 5, 2024 22:26
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.

2 participants