Build and Test #12
Workflow file for this run
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: Build and Test | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest # For a list of available runner types, refer to | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
env: | |
SM_CLIENT_CERT_FILE: D:\\Certificate_pkcs12.p12 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Set up certificate | |
run: | | |
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > ${{ env.SM_CLIENT_CERT_FILE }} | |
shell: bash | |
- name: Code signing with Software Trust Manager | |
uses: digicert/ssm-code-signing@v1.0.0 | |
env: | |
SM_API_KEY: ${{ secrets.SM_API_KEY }} | |
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }} | |
SM_HOST: ${{ secrets.SM_HOST }} | |
- name: Sync certificate | |
run: | | |
smctl credentials save ${{ env.SM_API_KEY }} ${{ env.SM_CLIENT_CERT_PASSWORD }} | |
smctl windows certsync --keypair-alias="${{ secrets.SM_KEYPAIR_ALIAS }}" | |
env: | |
SM_API_KEY: ${{ secrets.SM_API_KEY }} | |
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }} | |
SM_HOST: ${{ secrets.SM_HOST }} | |
- name: Execute unit tests | |
run: dotnet test | |
- name: Publish | |
run: dotnet publish Hercules\Hercules.csproj /p:PublishProfile=Hercules\Properties\PublishProfiles\PublishProfile.pubxml | |
- name: Sign Executables | |
run: | | |
smctl sign --fingerprint ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} --input bin\\hercules.exe --tool signtool | |
smctl sign --fingerprint ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} --input bin\\hercules.dll --tool signtool | |
- name: Create Installer | |
uses: Minionguyjpro/Inno-Setup-Action@v1.2.5 | |
with: | |
path: Setup/Hercules.iss | |
- name: Sign Installer | |
run: smctl sign --fingerprint ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} --input Setup\\Output\\hercules_setup.exe --tool signtool |