Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reusable actions #67

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/actions/materialize-signing-key/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Materialize signing key
description: Materializes key to sign assemblies
inputs:
signing-key-value:
description: Value of the signing key
required: true
signing-key-file-name:
description: Name of the signing key file
required: false
default: key.snk
outputs:
file-path:
description: Signing key file path
value: ${{ steps.signing-key.outputs.PATH }}
runs:
using: composite
steps:
- name: 🖊️ materialize signing key
id: signing-key
run: |
$path = [IO.Path]::Combine("${{ github.workspace }}","src","${{ inputs.signing-key-file-name }}")
[IO.File]::WriteAllBytes($path, [Convert]::FromBase64String("$env:StrongNameKey"))
"PATH=$path" >> $env:GITHUB_OUTPUT
shell: pwsh
env:
StrongNameKey: ${{ inputs.signing-key-value }}
14 changes: 5 additions & 9 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
Configuration: Release
Namespace: Objectivity.AutoFixture.XUnit2
StrongNameKeyName: key.snk
CoverageDirectory: ${{ github.workspace }}\src\opencover

defaults:
Expand Down Expand Up @@ -93,18 +92,15 @@ jobs:
fetch-depth: 0
- name: 🖊️ materialize signing key
id: signing-key
run: |
$path = [IO.Path]::Combine("${{ github.workspace }}","src","${{ env.StrongNameKeyName }}")
[IO.File]::WriteAllBytes($path, [Convert]::FromBase64String("$env:StrongNameKey"))
"PATH=$path" >> $env:GITHUB_OUTPUT
env:
StrongNameKey: ${{ secrets.SIGNING_KEY }}
uses: ./.github/actions/materialize-signing-key
with:
signing-key-value: ${{ secrets.SIGNING_KEY }}
- name: 🏗️ build
run: dotnet build ./src/${{ env.Namespace }}.${{ matrix.package_module }}.sln
env:
CI: true
StrongNameKey: ${{ secrets.SIGNING_KEY }}
StrongNameKeyPath: ${{ steps.signing-key.outputs.PATH }}
StrongNameKeyPath: ${{ steps.signing-key.outputs.file-path }}
- name: 🧪 test Core in net7.0 & collect coverage
id: core-code-coverage
run: |
Expand Down Expand Up @@ -143,7 +139,7 @@ jobs:
env:
CI: true
StrongNameKey: ${{ secrets.SIGNING_KEY }}
StrongNameKeyPath: ${{ steps.signing-key.outputs.PATH }}
StrongNameKeyPath: ${{ steps.signing-key.outputs.file-path }}
- name: 🔼 upload packages
uses: actions/upload-artifact@v3
with:
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/test-mutations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Configuration: Release
StrongNameKeyName: key.snk

defaults:
run:
Expand All @@ -35,12 +34,9 @@ jobs:
fetch-depth: 0
- name: 🖊️ materialize signing key
id: signing-key
run: |
$path = [IO.Path]::Combine("${{ github.workspace }}","src","${{ env.StrongNameKeyName }}")
[IO.File]::WriteAllBytes($path, [Convert]::FromBase64String("$env:StrongNameKey"))
"PATH=$path" >> $env:GITHUB_OUTPUT
env:
StrongNameKey: ${{ secrets.SIGNING_KEY }}
uses: ./.github/actions/materialize-signing-key
with:
signing-key-value: ${{ secrets.SIGNING_KEY }}
- name: 💾 install stryker.net
run: |
dotnet new tool-manifest
Expand All @@ -52,5 +48,5 @@ jobs:
env:
CI: true
StrongNameKey: ${{ secrets.SIGNING_KEY }}
StrongNameKeyPath: ${{ steps.signing-key.outputs.PATH }}
StrongNameKeyPath: ${{ steps.signing-key.outputs.file-path }}