Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveSkender committed Dec 30, 2024
1 parent a0079b9 commit e6d9361
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ name: Deploy NuGet package
# Version format: major.minor.patch[-preview.suffix]
# - Versioning managed by GitVersion
# - Preview suffix toggled by "preview" input
# - Non-preview versions restricted to main branch
# - Non-preview versions on nuget.org restricted to main branch;
# runs targeting nuget.org from non-"main" branches will fail early.
# - Default: patch increment unless "+semver:" message found
# or will use "next-version" if set in config
# - Preview numbers auto-increment (e.g., preview.1 -> preview.2)

on:
push:
branches:
- main
- 'v*'
- fix-deployer

workflow_dispatch:
Expand Down Expand Up @@ -38,7 +42,20 @@ concurrency:
cancel-in-progress: true

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Validate preview settings
run: |
if [[ "${{ github.event.inputs.environment }}" == "nuget.org" ]] && \
[[ "${{ github.ref }}" != "refs/heads/main" ]] && \
[[ "${{ github.event.inputs.preview }}" != "true" ]]; then
echo "::error::Non-preview versions on nuget.org are only allowed from main branch"
exit 1
fi
package:
needs: validate
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version_info.outputs.version }}
Expand Down
15 changes: 3 additions & 12 deletions src/gitversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,11 @@ branches:
increment: Patch
is-release-branch: true
is-mainline: true
prevent-increment-of-merged-branch-version: true
source-branches: []
tracks-release-branches: false
is-source-branch-for: ['feature', 'pull-request']
pre-release-weight: 55000
pull-request:
mode: ContinuousDelivery
tag: preview
increment: Inherit
prevent-increment-of-merged-branch-version: false
tag-number-pattern: '[/-](?<number>\d+)'
track-merge-target: true
source-branches: ['main']

feature:
regex: ^v\d+\..*
regex: ^(v\d+|fix|feature|dev).*
mode: ContinuousDelivery
tag: preview
increment: Inherit
Expand Down

0 comments on commit e6d9361

Please sign in to comment.