Skip to content

Commit

Permalink
Pipeline to automatically push new nuget package (#4)
Browse files Browse the repository at this point in the history
Co-authored-by: j.vanier <j.vanier@unitee.io>
Co-authored-by: justin.vanier <justin.vanier@epitech.eu>
  • Loading branch information
3 people authored Nov 22, 2021
1 parent d3ef5ed commit 60a1863
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pushing-new-version-nuget-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: pushing tag version for release

on:
push:
branches:
- main

tags:
- v*

jobs:
build:
if: contains(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- id: get_version
uses: battila7/get-version-action@v2

- name: set RELEASE_VERSION
run: echo "RELEASE_VERSION=${{ steps.get_version.outputs.version-without-v }}" >> $GITHUB_ENV

- name: Build and generate NuGet package
run: |
cd dotnet-img-proxy
dotnet build -c Release -p:Version=${RELEASE_VERSION}
dotnet pack -c Release -p:Version=${RELEASE_VERSION} -o out
- name: Push generated package
run: dotnet nuget push /home/runner/work/dotnet-img-proxy/dotnet-img-proxy/dotnet-img-proxy/out/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols true
3 changes: 1 addition & 2 deletions dotnet-img-proxy/dotnet-img-proxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>DotnetImgProxy</RootNamespace>
<PackageId>DotnetImgProxy</PackageId>
<Version>1.4.0</Version>
<Authors>Titouan CREACH</Authors>
<Authors>Titouan CREACH et Justin VANIER</Authors>
<Company>Ünitee</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
Expand Down

0 comments on commit 60a1863

Please sign in to comment.