Skip to content

Commit

Permalink
Add branch name to build version suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsmith committed Aug 25, 2024
1 parent ea769fb commit 144b826
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,26 @@ jobs:
6.0.x
8.0.x
- name: Build Reason
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
run: |
branch=${GITHUB_REF##*/}.
if [ "$branch" = "main" ]; then
branch=""
fi
if [ "$branch" = "master" ]; then
branch=""
fi
if [ "${GITHUB_REF%%/*}" = "refs/tags" ]; then
branch=""
fi
if [ "${GITHUB_REF%%/*}" = "refs/pull" ]; then
branch=""
fi
echo "GIT_BRANCH_SUFFIX=$branch" >> $GITHUB_ENV
echo branch: $GIT_BRANCH_SUFFIX ref: $GITHUB_REF event: $GITHUB_EVENT_NAME
- name: Build Version
run: |
dotnet tool install --global minver-cli --version 5.0.0
version=$(minver --tag-prefix v)
version=$(minver --tag-prefix v --default-pre-release-identifiers ${GIT_BRANCH_SUFFIX}alpha.0)
echo "MINVERVERSIONOVERRIDE=$version" >> $GITHUB_ENV
echo "### Version: $version" >> $GITHUB_STEP_SUMMARY
- name: Build
Expand Down

0 comments on commit 144b826

Please sign in to comment.