Skip to content

Bump gitreleasemanager.tool from 0.15.0 to 0.18.0 #2069

Bump gitreleasemanager.tool from 0.15.0 to 0.18.0

Bump gitreleasemanager.tool from 0.15.0 to 0.18.0 #2069

Workflow file for this run

name: .NET Core
on:
push:
branches: [ main, release* ]
tags: [ v* ]
pull_request:
branches: [ main, release* ]
env:
ECLINT_VERSION: "0.3.3"
_JAVA_OPTIONS: "-Xms10m -Xmx1024m"
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
BUILD_ARTIFACTS_FOLDER: build_artifacts
steps:
- name: "[Setup] - Checkout code"
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for GitVersion
submodules: 'recursive'
- name: "[Setup] - Set HOME env variable (Windows)"
if: ${{ runner.os == 'Windows' }}
shell: pwsh
run: |
"HOME=${env:GITHUB_WORKSPACE}" >> $env:GITHUB_ENV
- name: "[Setup] - .NET Core"
uses: actions/setup-dotnet@v3
with:
global-json-file: ./global.json
- name: "[Setup] - Install GitVersion"
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.10.3'
- name: "[Setup] - Install Ruby"
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: "[Setup] - Java" # required to build/install `freshli-agent-java`
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: "[Setup] - Set HOME env variable (Windows)"
if: ${{ runner.os == 'Windows' }}
shell: pwsh
run: |
"HOME=${env:GITHUB_WORKSPACE}" >> $env:GITHUB_ENV
- name: "[Versioning] - GitVersion Config"
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
additionalArguments: '/showConfig'
- name: "[Versioning] - Determine Version"
uses: gittools/actions/gitversion/[email protected]
id: gitversion
with:
useConfigFile: true
- name: "[Versioning] - Update csproj Files"
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
additionalArguments: '/updateprojectfiles'
- name: "[Versioning] - Display updated csproj File"
run: cat Corgibytes.Freshli.Cli/Corgibytes.Freshli.Cli.csproj
- name: "[Build] - Build"
run: dotnet build --configuration Release
- name: "[Build] - Setup for Acceptance Test Coverage Collection, and for running the linters"
run: |
dotnet tool restore
- name: "[Build] - dotnet build"
run: |
dotnet build -o exe
- name: "[Lint] - Install eclint on Linux"
if: runner.os != 'Windows'
run: |
curl -L https://gitlab.com/greut/eclint/-/releases/v$ECLINT_VERSION/downloads/eclint_${ECLINT_VERSION}_linux_x86_64.tar.gz -o /tmp/eclint_${ECLINT_VERSION}_linux_x86_64.tar.gz && \
mkdir -p $HOME/.local/opt/eclint && \
tar -zxvf /tmp/eclint_${ECLINT_VERSION}_linux_x86_64.tar.gz -C $HOME/.local/opt/eclint && \
rm /tmp/eclint_${ECLINT_VERSION}_linux_x86_64.tar.gz
echo "$HOME/.local/opt/eclint" >> $GITHUB_PATH
- name: "[Lint] - Install eclint on Windows"
if: runner.os == 'Windows'
run: |
New-Item -Type Directory -Force $HOME\.local\opt\eclint
Invoke-WebRequest -Uri https://gitlab.com/greut/eclint/-/releases/v$env:ECLINT_VERSION/downloads/eclint_${env:ECLINT_VERSION}_windows_x86_64.tar.gz -OutFile $HOME\.local\opt\eclint\eclint_${env:ECLINT_VERSION}_windows_x86_64.tar.gz
Set-Location $HOME\.local\opt\eclint
tar -zxvf .\eclint_${env:ECLINT_VERSION}_windows_x86_64.tar.gz
Write-Output "$HOME\.local\opt\eclint" | Out-File -Append $env:GITHUB_PATH
- name: "[Lint] - Run all linters"
run: |
ruby bin/lint.rb
- name: "[Test] - Install freshli-agent-java on Linux"
if: runner.os != 'Windows'
run: |
mkdir -p $HOME/.local/opt
cd $HOME/.local/opt
git clone https://github.com/corgibytes/freshli-agent-java
cd freshli-agent-java
./gradlew installDist
chmod a-x build/install/freshli-agent-java/bin/freshli-agent-java.bat
echo "$HOME/.local/opt/freshli-agent-java/build/install/freshli-agent-java/bin" >> $GITHUB_PATH
- name: "[Test] - Install freshli-agent-java on Windows"
if: runner.os == 'Windows'
run: |
New-Item -Type Directory -Force $HOME\.local\opt
Set-Location $HOME\.local\opt
git clone https://github.com/corgibytes/freshli-agent-java
Set-Location .\freshli-agent-java
.\gradlew installDist
Write-Output "$HOME\.local\opt\freshli-agent-java\build\install\freshli-agent-java\bin" | Out-File -Append $env:GITHUB_PATH
- name: "[Test] - Confirm freshli-agent-java availability"
run: |
freshli-agent-java --help
- name: "[Test] - Install freshli-agent-dotnet on Linux"
if: runner.os != 'Windows'
run: |
mkdir -p $HOME/.local/opt
cd $HOME/.local/opt
git clone https://github.com/corgibytes/freshli-agent-dotnet
cd freshli-agent-dotnet
bundle install
bundle exec ./bin/build.rb
echo "$HOME/.local/opt/freshli-agent-dotnet/exe" >> $GITHUB_PATH
- name: "[Test] - Install freshli-agent-dotnet on Windows"
if: runner.os == 'Windows'
run: |
New-Item -Type Directory -Force $HOME\.local\opt
Set-Location $HOME\.local\opt
git clone https://github.com/corgibytes/freshli-agent-dotnet
Set-Location .\freshli-agent-dotnet
bundle install
bundle exec .\bin\build.rb
Write-Output "$HOME\.local\opt\freshli-agent-dotnet\exe" | Out-File -Append $env:GITHUB_PATH
- name: "[Test] - Confirm freshli-agent-dotnet availability"
run: |
freshli-agent-dotnet --help
- name: "[Test] - Install dotnet-CycloneDX on Linux"
if: runner.os != 'Windows'
run: |
dotnet tool install --global CycloneDX
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: "[Test] - Install dotnet-CycloneDX on Windows"
if: runner.os == 'Windows'
run: |
dotnet tool install --global CycloneDX
Write-Output "$HOME\.dotnet\tools" | Out-File -Append $env:GITHUB_PATH
- name: "[Test] - Confirm dotnet-CycloneDX availability"
run: |
dotnet-CycloneDX --help
- name: "[Test] - Test, Generate Code Coverage"
run: |
dotnet coverlet ./exe --target "dotnet" --targetargs 'test --logger "console;verbosity=detailed" --blame-hang-timeout 10min exe/Corgibytes.Freshli.Cli.Test.dll' --format lcov
- name: "[Test] - Behavior Acceptance Tests"
run: |
bundle exec cucumber
- name: "[Test] - Send Code Coverage Data to Code Climate"
uses: paambaati/[email protected]
if: ${{ github.actor != 'dependabot[bot]' && runner.os != 'Windows' }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/coverage.info:lcov
- name: "[Publish] - Publish win-x64, linux-x64 and osx-x64"
if: runner.os != 'Windows'
run: |
dotnet publish -r win-x64 -c Release --self-contained false
dotnet publish -r linux-x64 -c Release --self-contained false
dotnet publish -r osx-x64 -c Release --self-contained false
- name: "[Post Publish] - Zip win-x64 Release"
if: runner.os != 'Windows'
uses: papeloto/action-zip@v1
with:
files: Corgibytes.Freshli.Cli/bin/Release/net7.0/win-x64/publish
dest: ${{ env.BUILD_ARTIFACTS_FOLDER }}/freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-win-x64.zip
- name: "[Post Publish] - Zip linux-x64 Release"
if: runner.os != 'Windows'
uses: papeloto/action-zip@v1
with:
files: Corgibytes.Freshli.Cli/bin/Release/net7.0/linux-x64/publish
dest: ${{ env.BUILD_ARTIFACTS_FOLDER }}/freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-linux-x64.zip
- name: "[Post Publish] - Zip osx-x64 Release"
if: runner.os != 'Windows'
uses: papeloto/action-zip@v1
with:
files: Corgibytes.Freshli.Cli/bin/Release/net7.0/osx-x64/publish
dest: ${{ env.BUILD_ARTIFACTS_FOLDER }}/freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-osx-x64.zip
- name: "[Post Publish] - View Build Artifacts Folder"
if: runner.os != 'Windows'
run: ls -la ${{ env.BUILD_ARTIFACTS_FOLDER }}
- name: "[Post Publish] - Upload win-x64 Assets as Github Workflow Artifacts"
if: runner.os != 'Windows'
uses: actions/upload-artifact@v3
with:
name: freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-alpha-win-x64.zip
path: ${{ env.BUILD_ARTIFACTS_FOLDER }}/freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-win-x64.zip
- name: "[Post Publish] - Upload linux-x64 Assets as Github Workflow Artifacts"
if: runner.os != 'Windows'
uses: actions/upload-artifact@v3
with:
name: freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-alpha-linux-x64.zip
path: ${{ env.BUILD_ARTIFACTS_FOLDER }}/freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-linux-x64.zip
- name: "[Post Publish] - Upload osx-x64 Assets as Github Workflow Artifacts"
if: runner.os != 'Windows'
uses: actions/upload-artifact@v3
with:
name: freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-alpha-osx-x64.zip
path: ${{ env.BUILD_ARTIFACTS_FOLDER }}/freshli-cli-${{ steps.gitversion.outputs.majorMinorPatch }}-osx-x64.zip
- name: "[Publish, Docker] - Set up QEMU"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
uses: docker/setup-qemu-action@v3
- name: "[Publish, Docker] - Set up Docker Buildx"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
uses: docker/setup-buildx-action@v3
- name: "[Publish, Docker] - Login to DockerHub"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "[Publish, Docker] - Login to GitHub Container Registry"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "[Publish, Docker] - Build, Push to GitHub Container Registry"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags:
ghcr.io/corgibytes/freshli-cli:latest,
ghcr.io/corgibytes/freshli-cli:${{ steps.gitversion.outputs.majorMinorPatch }},
ghcr.io/corgibytes/freshli-cli:${{ steps.gitversion.outputs.semVer }}-${{ steps.gitversion.outputs.fullBuildMetadata }}
cache-from: type=registry,ref=ghcr.io/corgibytes/freshli-cli:buildcache
cache-to: type=registry,ref=ghcr.io/corgibytes/freshli-cli:buildcache,mode=max
- name: "[Publish, Docker] - Smoke Test - `agents detect` via GitHub Container Registry image"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
run: |
docker run --rm ghcr.io/corgibytes/freshli-cli:${{ steps.gitversion.outputs.majorMinorPatch }} agents detect
- name: "[Publish, Docker] - Smoke Test - Analyze Java Fixture Repo via GitHub Container Registry image"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
run: |
docker run --rm ghcr.io/corgibytes/freshli-cli:${{ steps.gitversion.outputs.majorMinorPatch }} analyze https://github.com/corgibytes/freshli-fixture-java-test
- name: "[Publish, Docker] - Smoke Test - Analyze DotNet Fixture Repo via GitHub Container Registry image"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
run: |
docker run --rm ghcr.io/corgibytes/freshli-cli:${{ steps.gitversion.outputs.majorMinorPatch }} analyze https://github.com/corgibytes/freshli-fixture-csharp-test
- name: "[Publish, Docker] - Push to Docker Hub"
if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' }}
run: |
docker buildx imagetools create \
--tag corgibytes/freshli-cli:latest,
--tag corgibytes/freshli-cli:${{ steps.gitversion.outputs.majorMinorPatch }},
--tag corgibytes/freshli-cli:${{ steps.gitversion.outputs.semVer }}-${{ steps.gitversion.outputs.fullBuildMetadata }}
ghcr.io/corgibytes/freshli-cli:latest