Skip to content

Build and Sign

Build and Sign #2

name: Build and Sign
on:
workflow_dispatch:
inputs:
source_branch:
description: 'The source branch or ref to build from'
default: 'master'
required: true
release_name:
description: 'The name for the release'
required: true
env:
SOURCE_REPOSITORY: 'DiskCryptor/DiskCryptor'
SOURCE_REPOSITORY_NAME: 'DiskCryptor'
jobs:
build:
runs-on: windows-2022
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ env.SOURCE_REPOSITORY }}
ref: ${{ github.event.inputs.source_branch }}
fetch-depth: 1
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Build DCrypt
run: |
msbuild /t:build DCrypt\dcrypt.sln /p:Configuration="Release" /p:Platform=x64 /m
msbuild /t:build DCrypt\dcrypt.sln /p:Configuration="Release" /p:Platform=ARM64 /m
- name: Upload DCrypt
uses: actions/upload-artifact@v4.4.3
with:
name: DCrypt_Artifacts_PreSignature
path: |
DCrypt/Bin/Release_amd64/*.dll
DCrypt/Bin/Release_amd64/*.sys
DCrypt/Bin/Release_amd64/*.pdb
DCrypt/Bin/Release_amd64/*.exe
DCrypt/Bin/Release_arm64/*.dll
DCrypt/Bin/Release_arm64/*.pdb
DCrypt/Bin/Release_arm64/*.sys
DCrypt/Bin/Release_arm64/*.exe
sign:
environment: OSSign
needs: build
runs-on: windows-latest
permissions:
contents: write
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v5
with:
name: DCrypt_Artifacts_PreSignature
- uses: ossign/ossign@main
with:
config: $ {{ secrets.OSSIGN_CONFIG }}
token: $ {{ secrets.GITHUB_TOKEN }}
installOnly: false
inputFiles: |
DCRypt/Bin/Release_arm64/*.exe
DCrypt/Bin/Release_amd64/*.exe
fileType: pecoff
- name: Package files
run: |
7z a DCrypt/Bin/release_arm64.zip DCrypt/Bin/Release_arm64
7z a DCrypt/Bin/release_amd64.zip DCRypt/Bin/Release_amd64
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
README.md
DCrypt/Bin/release_arm64.zip
DCrypt/Bin/release_amd64.zip
name: $ {{ github.event.inputs.release_name }}
tag_name: $ {{ github.run_id }}
body: |
<img src="https://github.com/ossign.png" alt="OSSign Logo" width="100" height="100" />
# Signed Release ${{ github.event.inputs.release_name }}
These are the distributable files for the signed release of ${{ env.SOURCE_REPOSITORY_NAME }} ${{ github.event.inputs.release_name }}
The source code was fetched from https://github.com/${{ env.SOURCE_REPOSITORY }}@${{ github.event.inputs.source_branch }}