Skip to content

Build Executables

Build Executables #7

name: Build Executables
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release:
runs-on: windows-latest
strategy:
matrix:
dotnet-version: [ '8.x' ]
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set dotnet
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
# cache: true
# Step 3: Install dependencies
- name: Install dependencies
run: dotnet restore
# Step 4: Build Executables
- name: Build
run: dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true
# Step 5: Compress to zip
- name: Compress to zip
run: |
mkdir -p XMLDiffAndPatch
cp -r XMLPatch\bin\Release\net8.0\win-x64\XMLPatch.exe XMLDiffAndPatch
cp -r XMLDiff\bin\Release\net8.0\win-x64\XMLDiff.exe XMLDiffAndPatch
7z a -tzip XMLDiffAndPatch.zip XMLDiffAndPatch
shell: powershell
# Step 6: Upload Diff and Patch Archive as Artifact
- name: Upload Diff and Patch Archive as Artifact
uses: actions/upload-artifact@v4
with:
name: executables-archive
path: |
XMLDiffAndPatch.zip
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# Step 10: Scan with VirusTotal
-
name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
with:
update_release_body: true
vt_api_key: ${{ secrets.VT_API_KEY }}
github_token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
request_rate: 4
files: |
${{ github.event_name == 'release' && '.zip$' || '*.zip' }}