Skip to content

Commit

Permalink
more tries
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveSkender committed Dec 29, 2024
1 parent d2a868a commit 54ed13e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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"
Expand Down
17 changes: 16 additions & 1 deletion src/gitversion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mode: ContinuousDelivery
next-version: 3.0.0
next-version: 3.0.0 # only affects non-main branches

commit-message-incrementing: Enabled
major-version-bump-message: '\+semver:\s?(breaking|major)'
Expand All @@ -8,7 +8,22 @@ patch-version-bump-message: '\+semver:\s?(fix|patch)'
no-bump-message: '\+semver:\s?(none|skip)'

branches:
main:
regex: ^main$
increment: Patch
is-release-branch: true
is-mainline: true
pre-release-weight: 0
prevent-increment-of-merged-branch-version: true
tag: ''
pull-request:
tag: preview
increment: PreReleaseNumber
prevent-increment-of-merged-branch-version: false
source-branches: ['main']
feature:
regex: ^v\d+\..*
tag: preview
increment: PreReleaseNumber
prevent-increment-of-merged-branch-version: false
source-branches: ['main']

0 comments on commit 54ed13e

Please sign in to comment.