diff --git a/.github/workflows/nuget-release.yml b/.github/workflows/nuget-release.yml new file mode 100644 index 0000000..e147d16 --- /dev/null +++ b/.github/workflows/nuget-release.yml @@ -0,0 +1,41 @@ +name: Create a (Pre)release on NuGet + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-preview[0-9]+" +jobs: + release-nuget: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Verify commit exists in origin/main + run: | + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git branch --remote --contains | grep origin/main + + - name: Get version information from tag + id: get_version + uses: battila7/get-version-action@v2 + + - name: Restore dependencies + run: dotnet restore .\Source\Expressive\Expressive.csproj + + - name: Build + run: dotnet build --configuration Release --no-restore .\Source\Expressive\Expressive.csproj /p:Version=${{ steps.get_version.outputs.version-without-v }} + + - name: Pack + run: dotnet pack .\Source\Expressive\Expressive.csproj -c Release /p:Version=${{ steps.get_version.outputs.version-without-v }} --no-build --output . + + - name: Push + run: dotnet nuget push Expressive.${{ steps.get_version.outputs.version-without-v }}.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} + env: + GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }} + + - name: Push symbols + run: dotnet nuget push Expressive.${{ steps.get_version.outputs.version-without-v }}.snupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} + env: + GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }} \ No newline at end of file diff --git a/Source/Expressive/Expressive.csproj b/Source/Expressive/Expressive.csproj index 546c3a4..15cd5b1 100644 --- a/Source/Expressive/Expressive.csproj +++ b/Source/Expressive/Expressive.csproj @@ -14,7 +14,7 @@ Expressive Parser A multi-platform expression parsing and evaluating framework. Copyright(c) 2024 Shaun Lawrence - Expression Parser Evaluator Cross-Platform NET Standard Xamarin Xamarin.Forms + Expression Parser Evaluator Cross-Platform NET Standard Xamarin Xamarin.Forms MAUI logo-64.png MIT