Merge pull request #7 from kduma-OSS/dependabot/nuget/FileHasher.Libr… #23
This file contains hidden or 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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
branches: [ "master" ] | |
# Publish semver tags as releases. | |
tags: [ 'v*.*.*', 'v*.*', 'v*' ] | |
pull_request: | |
branches: [ "master" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal | |
- name: Prepare test directory | |
run: mkdir output | |
- name: Publish for win-x86 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime win-x86 --self-contained true --output output/win-x86/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime win-x86 --self-contained true --output output/win-x86/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime win-x86 --self-contained true --output output/win-x86/ | |
- name: Publish for win-x64 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime win-x64 --self-contained true --output output/win-x64/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime win-x64 --self-contained true --output output/win-x64/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime win-x64 --self-contained true --output output/win-x64/ | |
- name: Publish for win-arm | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime win-arm --self-contained true --output output/win-arm/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime win-arm --self-contained true --output output/win-arm/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime win-arm --self-contained true --output output/win-arm/ | |
- name: Publish for win-arm64 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime win-arm64 --self-contained true --output output/win-arm64/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime win-arm64 --self-contained true --output output/win-arm64/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime win-arm64 --self-contained true --output output/win-arm64/ | |
- name: Publish for linux-x64 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime linux-x64 --self-contained true --output output/linux-x64/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime linux-x64 --self-contained true --output output/linux-x64/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime linux-x64 --self-contained true --output output/linux-x64/ | |
- name: Publish for linux-arm | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime linux-arm --self-contained true --output output/linux-arm/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime linux-arm --self-contained true --output output/linux-arm/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime linux-arm --self-contained true --output output/linux-arm/ | |
- name: Publish for linux-arm64 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime linux-arm64 --self-contained true --output output/linux-arm64/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime linux-arm64 --self-contained true --output output/linux-arm64/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime linux-arm64 --self-contained true --output output/linux-arm64/ | |
- name: Publish for osx-x64 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime osx-x64 --self-contained true --output output/osx-x64/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime osx-x64 --self-contained true --output output/osx-x64/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime osx-x64 --self-contained true --output output/osx-x64/ | |
- name: Publish for osx-arm64 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime osx-arm64 --self-contained true --output output/osx-arm64/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime osx-arm64 --self-contained true --output output/osx-arm64/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime osx-arm64 --self-contained true --output output/osx-arm64/ | |
- name: Remove .pdb files | |
if: startsWith(github.ref, 'refs/tags/') | |
run: rm output/*/*.pdb | |
- name: Publish for win-x86-full | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime win-x86 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-x86-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime win-x86 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-x86-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime win-x86 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-x86-full/ | |
- name: Publish for win-x64-full | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime win-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-x64-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime win-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-x64-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime win-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-x64-full/ | |
- name: Publish for win-arm-full | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime win-arm --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-arm-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime win-arm --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-arm-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime win-arm --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-arm-full/ | |
- name: Publish for win-arm64-full | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime win-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-arm64-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime win-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-arm64-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime win-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/win-arm64-full/ | |
- name: Publish for linux-x64-full | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime linux-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-x64-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime linux-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-x64-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime linux-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-x64-full/ | |
- name: Publish for linux-arm-full | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime linux-arm --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-arm-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime linux-arm --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-arm-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime linux-arm --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-arm-full/ | |
- name: Publish for linux-arm64-full | |
if: startsWith(github.ref, 'refs/tags/') | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime linux-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-arm64-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime linux-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-arm64-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime linux-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/linux-arm64-full/ | |
- name: Publish for osx-x64-full | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime osx-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/osx-x64-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime osx-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/osx-x64-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime osx-x64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/osx-x64-full/ | |
- name: Publish for osx-arm64-full | |
run: > | |
dotnet publish FileHasher.CLI/FileHasher.CLI.csproj --configuration Release --runtime osx-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/osx-arm64-full/; | |
dotnet publish FileHasher.CLI.Check/FileHasher.CLI.Check.csproj --configuration Release --runtime osx-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/osx-arm64-full/; | |
dotnet publish FileHasher.CLI.Hash/FileHasher.CLI.Hash.csproj --configuration Release --runtime osx-arm64 --self-contained true -p:PublishTrimmed=false -p:IncludeAllContentForSelfExtract=false -p:IncludeNativeLibrariesForSelfExtract=false -p:PublishSingleFile=false --output output/osx-arm64-full/ | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for win-x86 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: win-x86 | |
path: output/win-x86/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for win-x64 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: win-x64 | |
path: output/win-x64/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for win-arm | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: win-arm | |
path: output/win-arm/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for win-arm64 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: win-arm64 | |
path: output/win-arm64/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for linux-x64 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: linux-x64 | |
path: output/linux-x64/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for linux-arm | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: linux-arm | |
path: output/linux-arm/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for linux-arm64 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: linux-arm64 | |
path: output/linux-arm64/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for osx-x64 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: osx-x64 | |
path: output/osx-x64/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for win-x86-full | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: win-x86-full | |
path: output/win-x86-full/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for win-x64-full | |
with: | |
name: win-x64-full | |
path: output/win-x64-full/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for win-arm-full | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: win-arm-full | |
path: output/win-arm-full/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for win-arm64-full | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: win-arm64-full | |
path: output/win-arm64-full/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for linux-x64-full | |
with: | |
name: linux-x64-full | |
path: output/linux-x64-full/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for linux-arm-full | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: linux-arm-full | |
path: output/linux-arm-full/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for linux-arm64-full | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: linux-arm64-full | |
path: output/linux-arm64-full/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for osx-x64-full | |
with: | |
name: osx-x64-full | |
path: output/osx-x64-full/ | |
retention-days: 7 | |
- uses: actions/upload-artifact@v3 | |
name: Upload artifacts for osx-arm64-full | |
with: | |
name: osx-arm64-full | |
path: output/osx-arm64-full/ | |
retention-days: 7 | |
- name: Zip published files | |
if: startsWith(github.ref, 'refs/tags/') | |
run: for i in output/*/; do zip --junk-paths --recurse-paths --move --test "${i%/}.zip" "$i"; done | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: output/*.zip |