Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #25
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: AntiDupl CI Build | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
branches: [ "master" ] | |
env: | |
VCPKG_DEFAULT_TRIPLET: x64-windows-static | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Debug, Release, Publish] | |
runs-on: windows-latest | |
env: | |
Solution_Name: ./src/AntiDupl.sln | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Read version.txt | |
id: version | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: ./src/version.txt | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
- name: Restore NuGet packages | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: nuget restore ${{env.Solution_Name}} | |
- name: Run and cache vcpkg dependecies | |
uses: lukka/[email protected] | |
with: | |
vcpkgGitCommitId: 501db0f17ef6df184fcdbfbe0f87cde2313b6ab1 | |
vcpkgJsonGlob: src/vcpkg.json | |
runVcpkgInstall: false | |
appendedCacheKey: '${{matrix.configuration}}' | |
- name: Integrate vcpkg | |
working-directory: ${{env.VCPKG_ROOT}} | |
run: | | |
${{ github.workspace }}/vcpkg/vcpkg.exe integrate install | |
- if: matrix.configuration == 'Release' || matrix.configuration == 'Debug' | |
name: Build | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: msbuild /m /p:Configuration=$env:Configuration $env:Solution_Name | |
env: | |
Configuration: ${{ matrix.configuration }} | |
- if: matrix.configuration == 'Publish' | |
name: Build | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: msbuild /m $env:Solution_Name /p:Configuration=$env:Configuration -restore -t:Publish -p:PublishProfile="AntiDuplPublishSingleFile" | |
env: | |
Configuration: ${{ matrix.configuration }} | |
- if: matrix.configuration == 'Release' | |
name: Make release binary and source files | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
cd cmd | |
.\MakeBin.cmd | |
- if: matrix.configuration == 'Publish' | |
name: Make release binary and source files | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
cd cmd | |
.\MakePublish.cmd | |
- if: matrix.configuration == 'Release' | |
name: Upload build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "AntiDupl.NET-${{ steps.version.outputs.content }} build" | |
path: | | |
${{ github.workspace }}\out\bin\AntiDupl.NET-${{ steps.version.outputs.content }}.exe | |
${{ github.workspace }}\out\bin\AntiDupl.NET-${{ steps.version.outputs.content }}.exe.hash.txt | |
${{ github.workspace }}\out\bin\AntiDupl.NET-${{ steps.version.outputs.content }}.zip | |
${{ github.workspace }}\out\bin\AntiDupl.NET-${{ steps.version.outputs.content }}.zip.hash.txt | |
- if: matrix.configuration == 'Publish' | |
name: Upload build SingleFilePortable | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "AntiDupl.NET-${{ steps.version.outputs.content }} build SingleFilePortable" | |
path: | | |
${{ github.workspace }}\out\Publish\AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.exe | |
${{ github.workspace }}\out\Publish\AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.exe.hash.txt | |
${{ github.workspace }}\out\Publish\AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.zip | |
${{ github.workspace }}\out\Publish\AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.zip.hash.txt | |
create-draft-release: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: build | |
runs-on: windows-latest | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Read version.txt | |
id: version | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: ./src/version.txt | |
- name: Load all artifacts | |
uses: actions/[email protected] | |
with: | |
name: "AntiDupl.NET-${{ steps.version.outputs.content }} build" | |
- name: Load all artifacts | |
uses: actions/[email protected] | |
with: | |
name: "AntiDupl.NET-${{ steps.version.outputs.content }} build SingleFilePortable" | |
- name: Virus Total Scan | |
id: scan_files | |
uses: crazy-max/ghaction-virustotal@v3 | |
with: | |
vt_api_key: ${{ secrets.VT_API_KEY }} | |
files: | | |
AntiDupl.NET-${{ steps.version.outputs.content }}.exe | |
AntiDupl.NET-${{ steps.version.outputs.content }}.zip | |
AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.exe | |
AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.zip | |
- name: Generate VirusTotal Body | |
shell: msys2 {0} | |
run: | | |
echo "🛡 [VirusTotal GitHub Action](https://github.com/crazy-max/ghaction-virustotal) analysis:" >> body.txt | |
echo "" >> body.txt | |
analysis="${{ steps.scan_files.outputs.analysis }}" | |
while read -d, -r pair; do | |
IFS='=' read -r filename analysisURL <<<"$pair" | |
echo "* [$(basename $filename)]($analysisURL)" >> body.txt | |
done <<<"$analysis," | |
- name: GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: "AntiDupl.NET v${{ steps.version.outputs.content }}" | |
body_path: body.txt | |
prerelease: true | |
files: | | |
AntiDupl.NET-${{ steps.version.outputs.content }}.exe | |
AntiDupl.NET-${{ steps.version.outputs.content }}.exe.hash.txt | |
AntiDupl.NET-${{ steps.version.outputs.content }}.zip | |
AntiDupl.NET-${{ steps.version.outputs.content }}.zip.hash.txt | |
AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.exe | |
AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.exe.hash.txt | |
AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.zip | |
AntiDupl.NET-${{ steps.version.outputs.content }}_SingleFilePortable.zip.hash.txt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |