Skip to content

Commit

Permalink
Merge pull request #142 from bijington/feature/add-release-pipeline
Browse files Browse the repository at this point in the history
Add nugget release pipeline
  • Loading branch information
bijington authored Feb 28, 2024
2 parents dc4a6b3 + 108f97d commit 09cea3d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/nuget-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion Source/Expressive/Expressive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Product>Expressive Parser</Product>
<Description>A multi-platform expression parsing and evaluating framework.</Description>
<Copyright>Copyright(c) 2024 Shaun Lawrence</Copyright>
<PackageTags>Expression Parser Evaluator Cross-Platform NET Standard Xamarin Xamarin.Forms</PackageTags>
<PackageTags>Expression Parser Evaluator Cross-Platform NET Standard Xamarin Xamarin.Forms MAUI</PackageTags>
<PackageIcon>logo-64.png</PackageIcon>
<PackageIconUrl />
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down

0 comments on commit 09cea3d

Please sign in to comment.