Upload to Chocolatey repo #6
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: Upload to Chocolatey repo | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore dependencies ChocolateStoreCore | |
run: | | |
cd ${{ github.workspace }}\ChocolateStoreCore | |
dotnet restore ${{ github.workspace }}\ChocolateStoreCore\ChocolateStoreCore.csproj -r win-x86 | |
- name: Build ChocolateStoreCore | |
run: | | |
dotnet build ${{ github.workspace }}\ChocolateStoreCore\ChocolateStoreCore.csproj --configuration Release --no-restore | |
- name: Publish | |
run: | | |
pwsh -File ${{ github.workspace }}\publish.ps1 -dir ${{ github.workspace }}\ChocolateStoreCore | |
- name: Create chocolatey package | |
run: | | |
pwsh -File ${{ github.workspace }}\package.ps1 -dir ${{ github.workspace }}\ChocolateStoreCore | |
- name: Add artefacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Assets | |
path: "${{ github.workspace }}/release/*.nupkg" | |
- name: Chocolatey | |
env: | |
CHOCOLATEY_API_KEY: ${{secrets.CHOCOLATEY_API_KEY}} | |
run: | | |
pwsh -File ${{ github.workspace }}\upload.ps1 -dir ${{ github.workspace }}\ChocolateStoreCore |