-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2a868a
commit 54ed13e
Showing
2 changed files
with
30 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,14 +46,14 @@ jobs: | |
- name: Set default inputs for dispatch | ||
id: settings | ||
run: | | ||
if [[ "${{ github.event_name }}" == "worfklow_dispatch" ]]; then | ||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
echo "environ=${{ inputs.environment }}" >> $GITHUB_OUTPUT | ||
echo "preview=${{ inputs.preview }}" >> $GITHUB_OUTPUT | ||
echo "dry_run=${{ inputs.dry_run }}" >> $GITHUB_OUTPUT | ||
else | ||
echo "environ='NO ENVIRONMENT" >> $GITHUB_OUTPUT | ||
echo "preview=true" >> $GITHUB_OUTPUT | ||
echo "dry_run=true" >> $GITHUB_OUTPUT | ||
echo "environ=NO_ENVIRONMENT" >> $GITHUB_OUTPUT | ||
echo "preview=true" >> $GITHUB_OUTPUT | ||
echo "dry_run=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Checkout source | ||
|
@@ -67,12 +67,6 @@ jobs: | |
dotnet-version: "9.x" | ||
dotnet-quality: "ga" | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: "9.x" | ||
dotnet-quality: "ga" | ||
|
||
- name: Setup GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
|
@@ -93,16 +87,19 @@ jobs: | |
- name: Compose version | ||
id: version_info | ||
run: | | ||
# get base version | ||
# get base version from GitVersion (respects tags on main, next-version on others) | ||
base="${{ steps.gitversion.outputs.majorMinorPatch }}" | ||
# determine preview suffix | ||
preview_tag="${{ steps.settings.outputs.preview && '-preview.' || '' }}" | ||
# determine preview number | ||
preview_num="${{ steps.settings.outputs.preview && steps.gitversion.outputs.preReleaseNumber || '' }}" | ||
# preview suffix controlled by workflow input + gitversion config | ||
if [[ "${{ steps.settings.outputs.preview }}" == "true" ]]; then | ||
# respect GitVersion preview tag config from gitversion.yml | ||
preview_tag="-${{ steps.gitversion.outputs.preReleaseTag }}." | ||
preview_num="${{ steps.gitversion.outputs.preReleaseNumber }}" | ||
else | ||
preview_tag="" | ||
preview_num="" | ||
fi | ||
# combine all parts | ||
ver="${base}${preview_tag}${preview_num}" | ||
echo "version=$ver" >> "$GITHUB_OUTPUT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters