Skip to content

v1.0.0

v1.0.0 #2

Workflow file for this run

name: Release
permissions:
packages: write
contents: read
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
version:
type: string
required: true
description: "The version of the package to release"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [6.0.x, 7.0.x, 8.0.x]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --no-restore
publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Extract the Version
run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | sed -e 's/^v//')" >> $GITHUB_ENV
if: github.event.release.tag_name != null
- name: Set the Version from Input
run: echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
if: github.event.release.tag_name == null
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore --version-suffix ${{ env.VERSION }}
- name: Pack
run: dotnet pack -c Release --no-build --no-restore --output ./pkgs --version-suffix ${{ env.VERSION }} --include-symbols
- name: Publish to GitHub Packages
run: dotnet nuget push ./pkgs/*.nupkg --source https://nuget.pkg.github.com/deveel/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
- name: Publish to NuGet
run: dotnet nuget push ./pkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}