Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 54 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
Expand Down Expand Up @@ -72,12 +70,61 @@ jobs:
- name: Package
run: dotnet pack --no-build -c Release -o artifacts /p:Version="${{ steps.version.outputs.FullSemVer }}"

- name: Upload package to MyGet
if: steps.version.outputs.PreReleaseTag != '' && !github.event.act
# ------------------------------------------------------
# PRE-RELEASE PACKAGES (ALPHA) — ONLY WHEN PR EXISTS
# ------------------------------------------------------
- name: Upload package to MyGet (only in PR)
if: |
github.event_name == 'pull_request' &&
steps.version.outputs.PreReleaseTag != '' &&
!github.event.act
run: dotnet nuget push "*.nupkg" -k ${{ secrets.MYGET_API_KEY }} -s https://www.myget.org/F/digillect/api/v3/index.json
working-directory: artifacts

- name: Upload package to NuGet
if: steps.version.outputs.PreReleaseTag == '' && !github.event.act
# ------------------------------------------------------
# RELEASE PACKAGES — ONLY WHEN PUSH TO MAIN
# ------------------------------------------------------
- name: Upload package to NuGet (only push to main)
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
steps.version.outputs.PreReleaseTag == '' &&
!github.event.act
run: dotnet nuget push "*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
working-directory: artifacts
working-directory: artifacts

# ---------------------------------------------
# CREATE TAG FOR RELEASE
# ---------------------------------------------
- name: Create Git Tag
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
steps.version.outputs.PreReleaseTag == '' &&
!github.event.act
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"

TAG="v${{ steps.version.outputs.FullSemVer }}"
git tag $TAG
git push origin $TAG

# ---------------------------------------------
# CREATE GITHUB RELEASE
# ---------------------------------------------
- name: Create GitHub Release
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
steps.version.outputs.PreReleaseTag == '' &&
!github.event.act
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.FullSemVer }}
name: Release ${{ steps.version.outputs.FullSemVer }}
body: |
## Changes in this release
${{ steps.version.outputs.Changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 12 additions & 12 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDeployment
strategies:
- MergeMessage
- TaggedCommit
- Mainline
- Fallback

branches:
main:
regex: ^master$|^main$
label: alpha
regex: ^main$
increment: Patch
is-release-branch: false
is-main-branch: true
tags:
regex: ^tags/v.+$
label: ''
source-branches: ['main']
increment: None
is-release-branch: true
is-main-branch: true

feature:
regex: ^feature[/-]
increment: Minor
is-release-branch: false
label: alpha

ignore:
sha: []
merge-message-formats: {}

commit-message-incrementing: Enabled