Skip to content

Copy and sign clitimer artifacts (#81) #526

Copy and sign clitimer artifacts (#81)

Copy and sign clitimer artifacts (#81) #526

Workflow file for this run

name: build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: build
runs-on: windows-latest
steps:
#clone, setup dotnet, restore packages
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup dotnet
uses: actions/setup-dotnet@v3
- name: dotnet restore
run: dotnet restore
- name: setup sonarqube
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/setup-sonar
#build with sonar analysis enabled
- name: Build and analyze
if: ${{ !github.event.pull_request.head.repo.fork }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"FrankvdStam_SoulSplitter_AYT9tJW7QlZ0fhD27xsa" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.cs.opencover.reportsPaths=tests/**/*.xml
dotnet build src/soulsplitter/soulsplitter.csproj -c release /p:Platform=x64
dotnet test -p:CollectCoverage=true -p:CoverletOutputFormat=opencover
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
#Forked repo's don't have access to the repository secrets and are unable to run sonarqube analysis
- name: Build only
if: ${{ github.event.pull_request.head.repo.fork }}
shell: powershell
run: |
dotnet build src/soulsplitter/soulsplitter.csproj -c release /p:Platform=x64
dotnet test
- name: Build CliTimer
shell: powershell
run: dotnet build src\CliTimer\CliTimer.csproj -c release /p:Platform=x64
#Collect all the artifacts and publish them
- name: collect artifacts
run: |
mkdir artifact
mkdir artifact\CliTimer
copy src\SoulSplitter\bin\x64\Release\net481\SoulSplitter.dll artifact
copy src\SoulSplitter\bin\x64\Release\net481\SoulMemory.dll artifact
copy src\SoulSplitter\bin\x64\Release\net481\MaterialDesignColors.dll artifact
copy src\SoulSplitter\bin\x64\Release\net481\MaterialDesignThemes.Wpf.dll artifact
copy src\SoulSplitter\bin\x64\Release\net481\soulmods_x86.dll artifact
copy src\SoulSplitter\bin\x64\Release\net481\soulmods_x64.dll artifact
copy src\SoulSplitter\bin\x64\Release\net481\soulmemory_rs_x86.dll artifact
copy src\SoulSplitter\bin\x64\Release\net481\soulmemory_rs_x64.dll artifact
copy src\SoulSplitter\bin\x64\Release\net481\launcher_x86.exe artifact
copy src\SoulSplitter\bin\x64\Release\net481\launcher_x64.exe artifact
copy LICENSE artifact
copy src\SoulMemory\bin\x64\Release\*.nupkg artifact
copy src\CliTimer\bin\x64\release\net481\CliTimer.exe artifact\CliTimer
copy src\CliTimer\bin\x64\release\net481\CliTimer.exe.config artifact\CliTimer
copy src\CliTimer\bin\x64\release\net481\SoulMemory.dll artifact\CliTimer
copy src\CliTimer\bin\x64\release\net481\soulmods_x86.dll artifact\CliTimer
copy src\CliTimer\bin\x64\release\net481\soulmods_x64.dll artifact\CliTimer
- name: sign artifacts
run: |
$bytes = [Convert]::FromBase64String("${{SECRETS.CERT_PFX_BASE64}}")
[IO.File]::WriteAllBytes("SoulSplitter.pfx", $bytes)
$signtool = "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\SoulSplitter.dll"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\SoulMemory.dll"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\soulmods_x86.dll"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\soulmods_x64.dll"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\soulmemory_rs_x86.dll"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\soulmemory_rs_x64.dll"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\launcher_x86.exe"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\launcher_x64.exe"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\CliTimer\CliTimer.exe"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\CliTimer\SoulMemory.dll"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\CliTimer\soulmods_x86.dll"
& $signtool sign /fd sha256 /f SoulSplitter.pfx /d "SoulSplitter" /t http://timestamp.digicert.com "artifact\CliTimer\soulmods_x64.dll"
- name: Publish SoulSplitter
uses: actions/upload-artifact@v4
with:
name: SoulSplitter
path: artifact