🚀 gha: Bump gittools/actions from 3.0.3 to 3.1.1 #655
Workflow file for this run
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
--- | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- "*" | |
paths: | |
- src/** | |
- global.json | |
- jmbde.sln | |
- .github/workflows/ci.yml | |
pull_request: | |
branches: | |
- main | |
paths: | |
- src/** | |
- global.json | |
- jmbde.sln | |
- .github/workflows/ci.yml | |
env: | |
CONFIGURATION: Release | |
DOTNET_CLI_TELEMETRY_OUTPUT: 1 | |
DOTNET_NOLOGO: 1 | |
DOTNET_SDK_VERSION: 7.0.x | |
NET_CORE_VERSION: net7.0 | |
NET_FRAMEWORK_VERSION: net48 | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: "🧊 Module Build" | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: "🧰 Checkout Source Code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "⚙️ Install GitVersion" | |
uses: gittools/actions/gitversion/setup@v3.1.1 | |
with: | |
versionSpec: '5.x' | |
- name: "⚙️ Execute GitVersion" | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v3.1.1 | |
- name: "⚙ Display the version" | |
run: | | |
echo "Version: ${{ steps.gitversion.outputs.semVer }}" | |
- name: "⚙️ Setup dotnet" | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: "⚙️ Check dotnet sdk install" | |
run: dotnet --info | |
- name: "⚙️ Install dependencies" | |
run: dotnet restore | |
- name: "🚧 Build solution" | |
run: | | |
dotnet tool update --global dotnet-ef | |
dotnet ef database update --project src/jmbde | |
dotnet build -p:Configuration=Release --no-restore -p:version=${{ steps.gitversion.outputs.semVer }} | |
- name: "📤 Upload artifact: Application" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DotnetSolution | |
path: ${{runner.workspace}}/dist | |
source-archive: | |
name: All Source Files | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: "🧰 Checkout Source Code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Restoring submodules | |
run: git submodule update --init | |
- name: Get the version | |
id: get_version | |
shell: bash | |
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) | |
- name: Checking out sources | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Create 7z source-archive | |
uses: DuckSoft/create-7z-action@v1.0 | |
with: | |
pathSource: ./ | |
pathTarget: ./anniversary-reminder-${{ steps.get_version.outputs.VERSION | |
}}-source-all.7z | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: source-files | |
path: ./anniversary-reminder-${{ steps.get_version.outputs.VERSION | |
}}-source-all.7z | |
tests: | |
name: ${{ matrix.session }} ${{ matrix.dotnet-version }} / ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { dotnet-version: "7.x", os: ubuntu-latest } | |
- { dotnet-version: "7.x", os: windows-latest } | |
- { dotnet-version: "7.x", os: macos-latest } | |
- { dotnet-version: "6.x", os: ubuntu-latest } | |
- { dotnet-version: "6.x", os: windows-latest } | |
- { dotnet-version: "6.x", os: macos-latest } | |
steps: | |
- name: "🧰 Checkout Source Code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "⚙️ Install GitVersion" | |
uses: gittools/actions/gitversion/setup@v3.1.1 | |
with: | |
versionSpec: '5.x' | |
- name: "⚙️ Execute GitVersion" | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v3.1.1 | |
- name: "⚙ Display the version" | |
run: | | |
echo "Version: ${{ steps.gitversion.outputs.semVer }}" | |
- name: "⚙️ Setup dotnet" | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: "⚙️ Check dotnet sdk install" | |
run: dotnet --info | |
- name: "⚙️ Install dependencies" | |
run: dotnet restore | |
- name: Unit & integration test | |
run: | | |
dotnet tool update --global dotnet-ef | |
dotnet ef database update --project src/jmbde | |
dotnet test -p:Configuration=Release --no-restore -p:version=${{ steps.gitversion.outputs.semVer }} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
releaseNotes: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Build Releasenotes | |
id: github_releasenotes | |
uses: release-drafter/release-drafter@v6.0.0 | |
with: | |
publish: "${{ steps.check-version.outputs.tag != '' }}" | |
tag: "${{ steps.check-version.outputs.tag }}" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
changeLog: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Build ChangeLog | |
id: github_changelog | |
uses: mikepenz/release-changelog-builder-action@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
body: ${{ steps.check-version.outputs }} | |
env: | |
GITHUB_TOKEN: $${{ secrets.GITHUB_TOKEN }} | |
deployPrereleases: | |
name: Deploy Pre-Release | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-20.04 | |
environment: PreRelease | |
needs: | |
- build | |
- tests | |
steps: | |
- name: Restore Dotnet Solution | |
uses: actions/download-artifact@v4 | |
with: | |
name: DotnetSolution | |
path: dist | |
- name: Upload Artifact to Pre-Release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Pre-Release Solution | |
path: dist | |
deploy: | |
name: Deploy Release on nuget | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-20.04 | |
environment: Release | |
needs: | |
- build | |
- tests | |
- changeLog | |
- releaseNotes | |
steps: | |
- name: Restore Dotnet Solution | |
uses: actions/download-artifact@v4 | |
with: | |
name: DotnetSolution | |
path: dist/ | |
- name: Collect Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget-packages | |
path: "**/*.nupkg" | |
# - name: Publish the package to NuGet.Org | |
# run: dotnet nuget push "**/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.PUBLISH_NUGET_ORG }} --skip-duplicate |