Skip to content

changed action to v4 #30

changed action to v4

changed action to v4 #30

Workflow file for this run

name: "Build"
on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
workflow_dispatch:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
env:
PACKAGE_PATH: './package'
jobs:
dotnet_workflow:
name: Pack
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_ADD_GLOBAL_TOOLS_TO_PATH: false
DOTNET_MULTILEVEL_LOOKUP: 0
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true
TERM: xterm
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Pack
working-directory: src
run: dotnet pack -o ${{ env.PACKAGE_PATH }}
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5
with:
nuget-api-key: ${{ secrets.NUGET_KEY }}
nuget-version: latest
- name: Get certificate
id: cert_file
uses: timheuer/base64-to-file@v1
with:
fileName: 'certfile.pfx'
encodedString: ${{ secrets.SIGNING_CERT }}
# Sign the package
- name: Sign NuGet Package
run: nuget sign "**/*.nupkg" -CertificatePath ${{ steps.cert_file.outputs.filePath }} -CertificatePassword "${{ secrets.CERT_PWD }}" -Timestamper http://timestamp.digicert.com -NonInteractive
- name: Publish NuGet package
run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish artifact
uses: actions/upload-artifact@master
with:
name: packaged-template
path: ./src/package