Skip to content

Commit

Permalink
Create Release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
IeuanWalker authored Aug 19, 2022
1 parent 52e1878 commit 61c772e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
release:
types: [published]

env:
NET_VERSION: 6.0.400
PROJECT_PATH: 'Scr/StateButton.csproj'
NUGET_PATH: './**/IeuanWalker.Maui.StateButton.${{ github.event.release.tag_name }}.nupkg'

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: Setup .NET ${{ env.NET_VERSION }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.NET_VERSION }}

- name: Install .NET MAUI ${{ env.NET_VERSION }}
run: dotnet workload install maui --ignore-failed-sources

- name: Restore dependencies
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: Build
run: dotnet build ${{ env.PROJECT_PATH }} -c Release /p:Version=${{ github.event.release.tag_name }} --no-restore

- uses: actions/upload-artifact@v3
with:
name: NuGet
path: ${{ env.NUGET_PATH }}

- name: Setup NuGet
uses: NuGet/[email protected]

- name: Publish
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}

0 comments on commit 61c772e

Please sign in to comment.