Skip to content

Commit

Permalink
ci: Fix Semantic Versioning For Pre-Release
Browse files Browse the repository at this point in the history
There is a strict specification for pre-release versions.

Previous template `<mj>.<mn>.<p>-pr<pr>-<run>.0` violated this pattern
and may irritate parsing and ordering semantic versions.

The new template aligns with the standards, so that, for example, a
previous pre-release version:

    16.0.1-pr158-717.0

is now generated as:

    16.0.1-pr.158.717.0

See-also: <https://semver.org/>
  • Loading branch information
mmichaelis committed Nov 29, 2023
1 parent 2b8b35b commit 574e7ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ jobs:
fi
actual_version=$(cat .release-version)
prnumber=${{ steps.read-prnumber.outputs.prnumber }}
next_version=$(semver --increment prerelease --preid pr${prnumber}-${{ github.run_number }} ${actual_version})
next_version=$(semver --increment prerelease --preid pr.${prnumber}.${{ github.run_number }} ${actual_version})
pnpm run setversion ${next_version} --filter=coremedia/* --dependencyVersion=${next_version}
pnpm install --no-frozen-lockfile
git commit -am "Set PR Version: ${next_version}"
echo "Chosen Pre-Release Version: ${next_version}"
echo "**Pre-Release Version:** ${next_version}" >> $GITHUB_STEP_SUMMARY
- name: Build
run: pnpm build
- name: Lint
Expand Down

0 comments on commit 574e7ad

Please sign in to comment.