Skip to content

Commit

Permalink
change ci to install gitversion via official actions (#11)
Browse files Browse the repository at this point in the history
* nuget updates

* dependabot update

* update ci gitversion

* fix gitversion output casing
  • Loading branch information
f2calv authored Jun 12, 2023
1 parent 864a070 commit 65077ea
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
24 changes: 15 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: Serilog.AspNetCore
- dependency-name: Serilog.Enrichers.Environment
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
time: "04:00"

- package-ecosystem: nuget
directory: "/"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: Serilog.AspNetCore
- dependency-name: Serilog.Enrichers.Environment
29 changes: 15 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
build_app:
runs-on: ubuntu-latest
outputs:
SemVer: ${{ steps.gitversion.outputs.SemVer }}
FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}
semVer: ${{ steps.gitversion.outputs.semVer }}
fullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}

steps:
- uses: actions/checkout@v3
Expand All @@ -38,22 +38,23 @@ jobs:
with:
dotnet-version: 7.0.x

- name: gitversion
shell: pwsh
- name: gitversion (1 of 2)
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: 5.x

- name: gitversion (2 of 2)
id: gitversion
run: |
dotnet tool update -g GitVersion.Tool
$GitVersion = dotnet-gitversion ${{ github.workspace }} /nofetch | ConvertFrom-Json
Write-Host "SemVer=$($GitVersion.SemVer)"
echo "SemVer=$($GitVersion.SemVer)" >> $env:GITHUB_OUTPUT
Write-Host "FullSemVer=$($GitVersion.FullSemVer)"
echo "FullSemVer=$($GitVersion.FullSemVer)" >> $env:GITHUB_OUTPUT
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
additionalArguments: /nofetch

- name: dotnet restore
run: dotnet restore --verbosity minimal --configfile NuGet.config

- name: dotnet build
run: dotnet build -c Release --nologo --no-restore -p:Version='${{ steps.gitversion.outputs.FullSemVer }}' -p:SourceRevisionId=${{ github.sha }}
run: dotnet build -c Release --nologo --no-restore -p:Version='${{ steps.gitversion.outputs.fullSemVer }}' -p:SourceRevisionId=${{ github.sha }}

#TODO: could run dotnet test here, etc...

Expand All @@ -70,7 +71,7 @@ jobs:
REGISTRY: ghcr.io
#REPOSITORY: Note: set dynamically, i.e. github.repository_owner+IMAGE_NAME
GIT_REPO: ${{ github.repository }}
GIT_TAG: ${{ needs.build_app.outputs.SemVer }}
GIT_TAG: ${{ needs.build_app.outputs.semVer }}
GIT_BRANCH: ${{ github.ref }}
GIT_COMMIT: ${{ github.sha }}

Expand Down Expand Up @@ -142,7 +143,7 @@ jobs:
env:
REGISTRY: ghcr.io
#REPOSITORY: Note: set dynamically, i.e. github.repository_owner+IMAGE_NAME
GIT_TAG: ${{ needs.build_app.outputs.SemVer }}
GIT_TAG: ${{ needs.build_app.outputs.semVer }}
HELM_EXPERIMENTAL_OCI: 1
HELM_VERSION_TO_INSTALL: 3.9.2 #Note: keep this version in sync inside the devcontainer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" />
</ItemGroup>

Expand Down

0 comments on commit 65077ea

Please sign in to comment.