Build Cryptlex.LexActivator package #99
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 Cryptlex.LexActivator 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.LexActivator/Cryptlex.LexActivator.nuspec | |
- name: Update Library Version | |
run: | | |
sed -i '/lexactivator_version =/!b;c$lexactivator_version ="v${{ github.event.inputs.libraryVersion }}"' post-build.ps1 | |
- name: Commit, Tag and Push | |
run: | | |
git add ./src/Cryptlex.LexActivator/Cryptlex.LexActivator.nuspec | |
git add post-build.ps1 | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git commit -m "chore(package version): 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 main --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.LexActivator.sln | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v1.0.2 | |
- name: Build Solution | |
run: msbuild Cryptlex.LexActivator.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.LexActivator\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.LexActivator\Cryptlex.LexActivator.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 | |