Skip to content

Build Cryptlex.LexFloatClient package #36

Build Cryptlex.LexFloatClient package

Build Cryptlex.LexFloatClient package #36

Workflow file for this run

name: Build Cryptlex.LexFloatClient package
on:
workflow_dispatch:
inputs:
libraryVersion:
description: 'Library Version'
required: true
default: ''
packageVersion:
description: 'Package Version'
required: true
default: ''
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update Package Version
run: |
sed -i '/<version>/!b;c \ \ \ \ <version>${{ github.event.inputs.packageVersion }}</version>' ./src/Cryptlex.LexFloatClient/Cryptlex.LexFloatClient.nuspec
- name: Update Library Version
run: |
sed -i '/lexfloatclient_version =/!b;c$lexfloatclient_version ="v${{ github.event.inputs.libraryVersion }}"' post-build.ps1
- name: Commit, Tag and Push
run: |
git add ./src/Cryptlex.LexFloatClient/Cryptlex.LexFloatClient.nuspec
git add post-build.ps1
git config user.name github-actions
git config user.email [email protected]
git commit -m "updated version" | exit 0
git tag ${{ github.event.inputs.packageVersion }}
git push & git push --tags
build-publish:
needs: update-version
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- run: git pull origin master --ff-only
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: '5.8.1'
- name: Restore NuGet Packages
run: nuget restore Cryptlex.LexFloatClient.sln
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Build Solution
run: msbuild Cryptlex.LexFloatClient.sln /p:platform="Any CPU" /p:configuration="Release" /p:VisualStudioVersion="16.0"
- name: Signing DLLs
uses: GabrielAcostaEngler/signtool-code-sign@main
with:
certificate: '${{ secrets.SIGNING_CERTIFICATE }}'
cert-password: '${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}'
cert-sha1: '${{ secrets.SIGNING_CERTIFICATE_SHA }}'
folder: '.\src\Cryptlex.LexFloatClient\bin\Release\'
recursive: true
timestamp-server: 'http://timestamp.sectigo.com'
- name: Download Native Libs
run: .\post-build.ps1
shell: powershell
- name: Pack NuGet Package
run: nuget pack src\Cryptlex.LexFloatClient\Cryptlex.LexFloatClient.nuspec -NonInteractive -OutputDirectory nupkg -Properties Configuration=Release -Verbosity Detailed
- name: Sign NuGet Package
run: nuget sign .\nupkg\*.nupkg -CertificateFingerprint ${{ secrets.SIGNING_CERTIFICATE_SHA }} -CertificateStoreLocation LocalMachine -CertificateStoreName My -Timestamper http://timestamp.sectigo.com
- name: Push NuGet Package
run: nuget push nupkg\*.nupkg -SkipDuplicate -Source https://api.nuget.org/v3/index.json -NoSymbols