Skip to content

Commit

Permalink
[documentation][enhancement]: cleanup (#4)
Browse files Browse the repository at this point in the history
[documentation][enhancement]: cleanup (#4)
  • Loading branch information
leblancmeneses authored May 29, 2024
1 parent 8cf59c9 commit 164bc9c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
9 changes: 8 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
npm run build
if ! git diff --quiet --exit-code -- dist/apps/version-autopilot; then
npm run build

if git diff --quiet --exit-code -- dist/apps/version-autopilot; then
echo "Error: Recommit as there are changes in the dist/apps/version-autopilot folder."
exit 1
fi
fi
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Version Autopilot

This is perfect for packages that are not meant to be consumed by other packages, like a website or a mobile app,
where semantic versioning is not required.
This is perfect for packages that are not meant to be **consumed** by other packages, like a website or a mobile app,
where semantic versioning is not required and is continuously deployed.

This will automatically increment the version on every "run" of your github action pipeline.
This will automatically increment the version on every **run** of your github action pipeline.


```yaml
Expand All @@ -25,8 +25,14 @@ steps:
- name: example in README.md output
run: |
echo "github.run_number: ${{ github.run_number }}"
# useful for container image and package names
echo "version_autopilot_string_recommended: ${{ steps.version-autopilot.outputs.version_autopilot_string_recommended }}"
# base to derive your own versioning naming scheme
echo "version_autopilot_string: ${{ steps.version-autopilot.outputs.version_autopilot_string }}"
# android and ios version codes
echo "version_autopilot_code: ${{ steps.version-autopilot.outputs.version_autopilot_code }}"
```
Expand All @@ -35,11 +41,13 @@ steps:
If you have an existing application you can modify the `major`.`minor` and `shift` inputs to match the current version of your application.
See our [.github/workflows/tests.version-autopilot.yml](.github/workflows/tests.version-autopilot.yml) for how rollover works. We leverage `${{github.run_number}}` internally to increment the version.

If you are looking for semantic versioning use a [release pipeline](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
If you are looking for semantic versioning research [release pipeline](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) and git tags.


## Need help with your continuous delivery or k8s clusters?

We can help you with that. Contact us at [improvingstartups.com](https://improvingstartups.com) for more information.
Large language models (LLMs) cannot solve your organization's people problems.
If your software teams need help and are falling behind, consider an actual human
who can spot and help steer the ship away from danger.

Example of where we use this publicly: [k8s packages](https://console.cloud.google.com/artifacts/docker/wwwrobusthavencom/us-central1/public-dev?project=wwwrobusthavencom)
Contact us at [improvingstartups.com](https://improvingstartups.com).
2 changes: 1 addition & 1 deletion apps/version-autopilot/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function run() {
const patch = process.env['PATCH_OVERRIDE']? parseInt(process.env['PATCH_OVERRIDE'] || '0', 10) : github.context.runNumber;
const version = getVersion(major, minor, patch, shift);
const shortSha = `${github.context.sha}`.substring(0, 12);
let versionStringRecommended = `${version.versionString}-${process.env['GITHUB_HEAD_REF'] || ''}-${shortSha}`;
let versionStringRecommended = `${version.versionString}-${process.env['GITHUB_REF_NAME'] || ''}-${shortSha}`;
if (github.context.eventName === 'pull_request') {
versionStringRecommended = `${version.versionString}-pr-${github.context.payload.pull_request.number}-${shortSha}`;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/apps/version-autopilot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23123,7 +23123,7 @@ async function run() {
const patch = process.env["PATCH_OVERRIDE"] ? parseInt(process.env["PATCH_OVERRIDE"] || "0", 10) : github.context.runNumber;
const version2 = getVersion(major, minor, patch, shift);
const shortSha = `${github.context.sha}`.substring(0, 12);
let versionStringRecommended = `${version2.versionString}-${process.env["GITHUB_HEAD_REF"] || ""}-${shortSha}`;
let versionStringRecommended = `${version2.versionString}-${process.env["GITHUB_REF_NAME"] || ""}-${shortSha}`;
if (github.context.eventName === "pull_request") {
versionStringRecommended = `${version2.versionString}-pr-${github.context.payload.pull_request.number}-${shortSha}`;
}
Expand Down

0 comments on commit 164bc9c

Please sign in to comment.