Skip to content

Commit

Permalink
Create publish-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
snixtho committed Oct 18, 2023
1 parent a7c6f55 commit 5eb4059
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Release
on:
push:
tags:
- '*.*.*'

jobs:
build:
env:
SOLUTION: 'EvoSC.Tool.sln'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Setup Dependencies
run: dotnet restore $SOLUTION

- name: Build Solution
run: dotnet build $SOLUTION --configuration Release -p:Version=${{github.ref_name}} --no-restore

- name: Run Tests
run: dotnet test $SOLUTION /p:Configuration=Release --verbosity normal

- name: Nuget Pack
run: dotnet pack $SOLUTION /p:Version=${{github.ref_name}} -c Release --no-build --output package/

- name: ZIP Artifacts
uses: papeloto/action-zip@v1
with:
files: package/
dest: package.zip

- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: package
path: ${{ github.workspace }}/package.zip

- name: NuGet Publish
run: dotnet nuget push "package/EvoSC.Tool.${{github.ref_name}}.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

0 comments on commit 5eb4059

Please sign in to comment.