Skip to content

Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0 #59

Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0

Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0 #59

name: GitHubActionsBuilds
on: push
jobs:
generate_version_number:
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
build_number: ${{ github.ref == 'refs/heads/master' && steps.buildnumber.outputs.build_number || 1 }}
steps:
- name: Generate build number
if: github.ref == 'refs/heads/master'
id: buildnumber
uses: onyxmueller/build-tag-number@v1
with:
token: ${{secrets.github_token}}
build_docker:
needs: generate_version_number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: devedse
password: ${{ secrets.DOCKERHUBTOKEN }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Run Buildx
run: |
export VERSION=1.0.${{needs.generate_version_number.outputs.build_number}}
echo Version: $VERSION
docker buildx build -f DeveLanCacheUI_SteamDepotFinder.ConsoleApp/Dockerfile --build-arg BUILD_VERSION=$VERSION --platform linux/arm,linux/arm64,linux/amd64 -t devedse/develancacheui_steamdepotfinderconsoleapp:${{needs.generate_version_number.outputs.build_number}} -t devedse/develancacheui_steamdepotfinderconsoleapp:latest ${{ github.ref == 'refs/heads/master' && '--push' || '' }} .
build_linux:
needs: generate_version_number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: dotnet restore
run: dotnet restore DeveLanCacheUI_SteamDepotFinder.sln
- name: dotnet build
run: dotnet build DeveLanCacheUI_SteamDepotFinder.sln -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: dotnet test
run: dotnet test DeveLanCacheUI_SteamDepotFinder.sln -c Release --no-build --verbosity normal
build_windows:
needs: generate_version_number
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '19' # The JDK version to make available on the path.
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- name: Install tools
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-reportgenerator-globaltool
- name: dotnet restore
run: dotnet restore DeveLanCacheUI_SteamDepotFinder.sln
- name: SonarQube begin
run: dotnet-sonarscanner begin /k:"DeveLanCacheUI_SteamDepotFinder" /o:"devedse-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login=${{secrets.SONARQUBETOKEN}} /d:sonar.cs.opencover.reportsPaths=".\DeveLanCacheUI_SteamDepotFinder.Tests\TestResults\*\coverage.opencover.xml" /d:sonar.coverage.exclusions="DeveLanCacheUI_SteamDepotFinder.ConsoleApp/**/*.cs,DeveLanCacheUI_SteamDepotFinder.Tests/**/*.cs"
- name: dotnet build
run: dotnet build DeveLanCacheUI_SteamDepotFinder.sln -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: dotnet test
run: dotnet test DeveLanCacheUI_SteamDepotFinder.sln --verbosity normal --no-build -c Release --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura,opencover
- name: SonarQube end
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet-sonarscanner end /d:sonar.login=${{secrets.SONARQUBETOKEN}}
- name: Run CodeCov
uses: codecov/codecov-action@v3
with:
directory: ./DeveLanCacheUI_SteamDepotFinder.Tests/TestResults
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Run GoPackage.ps1 script
run: .\Scripts\GoPackage.ps1
shell: pwsh
- uses: actions/upload-artifact@v4
with:
name: DeveLanCacheUI_SteamDepotFinder7z
path: ./Scripts/Output/DeveLanCacheUI_SteamDepotFinder.7z
- uses: actions/upload-artifact@v4
with:
name: DeveLanCacheUI_SteamDepotFinderZip
path: ./Scripts/Output/DeveLanCacheUI_SteamDepotFinder.zip
release_github:
needs: [generate_version_number, build_windows, build_linux, build_docker]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts/
- name: Display structure of downloaded files
run: |
cd ./artifacts/
ls -R
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: 1.0.${{needs.generate_version_number.outputs.build_number}}
release_name: 1.0.${{needs.generate_version_number.outputs.build_number}}
body: |
${{ github.event.head_commit.message }}
draft: false
prerelease: false
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: 1.0.${{needs.generate_version_number.outputs.build_number}}
files: |
./artifacts/DeveLanCacheUI_SteamDepotFinder7z/DeveLanCacheUI_SteamDepotFinder.7z
./artifacts/DeveLanCacheUI_SteamDepotFinderZip/DeveLanCacheUI_SteamDepotFinder.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}