Skip to content

Commit

Permalink
Introducing a GitHub Actions script for releasing the libraries to Nu…
Browse files Browse the repository at this point in the history
…get.org
  • Loading branch information
tsutomi committed Apr 17, 2023
1 parent b13714b commit abce0bb
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Webhooks Release"

on:
release:
types: [published]

jobs:
build:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Set VERSION variable from tag
run: |
TAG=${{ github.event.release.tag_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Add Deveel GitHub NuGet Source
run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore -c Release /p:Version=$VERSION

- name: Test
run: dotnet test --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*"

- name: Collect to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.OCM_CODECOV_TOKEN }}

- name: Pack
run: dotnet pack --configuration Release --no-restore --no-build --include-symbols -p:PackageVersion=$VERSION --output ./nuget

- name: Push Packages to GitHub NuGet

run: dotnet nuget push ./nuget/**/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

0 comments on commit abce0bb

Please # to comment.