Skip to content

Commit d121f6a

Browse files
authored
Merge pull request #34 from vb2ae/31-digitally-sign-dll
31 digitally sign dll
2 parents f098896 + 748dcca commit d121f6a

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

.github/workflows/deploy.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ concurrency:
55
cancel-in-progress: true
66

77
on:
8-
workflow_dispatch: # Allow running the workflow manually from the GitHub UI
9-
push:
10-
branches:
11-
- 'main' # Run the workflow when pushing to the main branch
8+
workflow_run:
9+
workflows: [.NET]
10+
types:
11+
- completed
1212

1313
env:
14-
servicelocator_sln : "vb2ae.ServiceLocator.MSDependencyInjection.sln"
1514
package_feed: "https://api.nuget.org/v3/index.json"
16-
nuget_folder: "\\packages"
1715

1816
jobs:
1917
deployment:
@@ -25,12 +23,26 @@ jobs:
2523
uses: actions/setup-dotnet@v4
2624
with:
2725
dotnet-version: 9.0.x
28-
- name: Restore dependencies
29-
run: dotnet restore ${{env.servicelocator_sln}}
30-
- name: Build
31-
run: dotnet build ${{env.servicelocator_sln}} --no-restore --configuration Release
32-
- name: Pack Nuget
33-
run: dotnet pack ${{env.servicelocator_sln}} --output ${{env.nuget_folder}}
26+
- name: Get run ID of "Build" workflow
27+
id: get-run-id
28+
run: |
29+
REPO_NAME="${{ github.repository }}"
30+
WF_NAME="dotnet.yml"
31+
RUN_ID=`gh run --repo ${REPO_NAME} list --workflow ${WF_NAME} --json databaseId --jq .[0].databaseId`
32+
echo "Detected latest run id of ${RUN_ID} for workflow ${WF_NAME}"
33+
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
- name: Download artifact from "Build" workflow
37+
uses: actions/download-artifact@v4
38+
with:
39+
name: published_nuget # Match name used in dotnet-core.yml upload artifact step
40+
github-token: ${{ github.token }}
41+
repository: ${{ github.repository }}
42+
run-id: ${{ steps.get-run-id.outputs.run-id }}
43+
- name: Display structure of downloaded files
44+
run: ls -R
45+
3446

3547
- name: publish Nuget Packages to GitHub
3648
run: dotnet nuget push packages/*.nupkg --source ${{env.package_feed}} --api-key ${{secrets.PUBLISH_TO_NUGET}} --skip-duplicate
596 Bytes
Binary file not shown.

vb2ae.ServiceLocator.MSDependencyInjection/vb2ae.ServiceLocator.MSDependencyInjection.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@
99
<RepositoryUrl>https://github.com/vb2ae/vb2ae.ServiceLocator.MSDependencyInjection</RepositoryUrl>
1010
<RepositoryType>git</RepositoryType>
1111
<PackageTags>common service locator</PackageTags>
12-
<AssemblyVersion>0.7.0</AssemblyVersion>
13-
<Version>0.7.0</Version>
12+
<AssemblyVersion>0.9.0</AssemblyVersion>
13+
<Version>0.9.0</Version>
1414
<Title>CommonService Locator for MS.Dependency Injection</Title>
1515
<PackageProjectUrl>https://github.com/vb2ae/vb2ae.ServiceLocator.MSDependencyInjection</PackageProjectUrl>
1616
<Copyright>2024</Copyright>
1717
<Description>The purpose of this class library is to be able to use Microsoft.Extensions.DependencyInjection with the common service locator.</Description>
1818
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1919
<Authors>Ken Tucker</Authors>
2020
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
21+
<SignAssembly>True</SignAssembly>
22+
<AssemblyOriginatorKeyFile>servicelocator.snk</AssemblyOriginatorKeyFile>
2123
</PropertyGroup>
2224

2325
<ItemGroup>

0 commit comments

Comments
 (0)