Skip to content

Webhooks Release (Manual) #4

Webhooks Release (Manual)

Webhooks Release (Manual) #4

name: "Webhooks Release (Manual)"
permissions:
contents: read
packages: write
on:
workflow_dispatch:
inputs:
version:
type: string
description: 'Version number'
required: true
jobs:
build:
name: "Build and Test"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
dotnet: [ '6.0.x', '7.0.x', '8.0.x' ]
steps:
- uses: actions/checkout@v3
- name: Set the TFM
run: |
VERSION=$(echo "${{ matrix.dotnet }}" | sed 's/[^0-9.]*//g')
VERSION=$(echo "${VERSION}" | sed 's/\.$//')
DOTNET_TFM="net${VERSION}"
echo "DOTNET_TFM=$DOTNET_TFM" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release /p:Version=${{ inputs.version }} -f ${{ env.DOTNET_TFM }}
- name: Test
run: dotnet test --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*" -f ${{ env.DOTNET_TFM }}
- 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=${{ inputs.version }} --output ./nuget
- name: Push Packages to GitHub NuGet
run: dotnet nuget push ./nuget/**/*.nupkg --skip-duplicate --api-key ${{secrets.GITHUB_TOKEN}} --source "https://nuget.pkg.github.com/deveel/index.json"
- 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