Skip to content

Commit

Permalink
Add release build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wcoder committed May 2, 2022
1 parent 8da2597 commit bf3d864
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin '+refs/heads/*:refs/remotes/origin/*'
git branch --remote --contains | grep origin/master
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Pack
run: |
dotnet pack FB2Library/FB2Library.csproj \
-p:NuspecFile=../nuget/FB2Library.nuspec \
-p:NuspecProperties="version=${VERSION}" \
--configuration Release \
--verbosity normal \
--include-symbols \
--include-source \
--output .
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: nupkg
path: '*.nupkg'

deploy-nuget:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: nupkg
- name: Push to NuGet
run: |
dotnet nuget push ./nupkg/FB2Library.*.nupkg \
--source ${FEED_URL} \
--api-key ${FEED_KEY}
env:
FEED_URL: https://api.nuget.org/v3/index.json
FEED_KEY: ${{ secrets.NUGET_KEY }}

0 comments on commit bf3d864

Please sign in to comment.