Louis Seubert
8dc3fab376
Some checks failed
dotnet publish / package (8.0) (push) Failing after 24s
Add projects for creating new sdk based msbuild projects.
45 lines
No EOL
1.5 KiB
YAML
45 lines
No EOL
1.5 KiB
YAML
name: dotnet publish
|
|
on:
|
|
push:
|
|
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
|
|
branches: [ 'main', 'develop' ]
|
|
|
|
jobs:
|
|
package:
|
|
runs-on: debian-latest
|
|
strategy:
|
|
matrix:
|
|
dotnet-version: [ '8.0' ]
|
|
container: mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet-version }}
|
|
steps:
|
|
- uses: https://git.geekeey.de/actions/checkout@1
|
|
- name: NuGet login
|
|
shell: bash
|
|
run: |
|
|
# This token readonly and can only be used for restore
|
|
dotnet nuget update source geekeey --store-password-in-clear-text \
|
|
--username "${{ github.actor }}" --password "${{ github.token }}"
|
|
- name: .NET pack
|
|
shell: bash
|
|
run: |
|
|
if [[ ${{ github.ref_name }} =~ [0-9]+.[0-9]+.[0-9]+ ]]
|
|
then
|
|
PROJECT_VERSION="${{ github.ref_name }}"
|
|
PROJECT_VERSION_SUFFIX=""
|
|
else
|
|
PROJECT_VERSION="$( git describe --tags 2>/dev/null || '1.0.0' )"
|
|
case "${{ github.ref_name }}" in
|
|
develop) PROJECT_VERSION_SUFFIX="-alpha" ;;
|
|
*) PROJECT_VERSION_SUFFIX="-unknown" ;;
|
|
esac
|
|
fi
|
|
dotnet pack -p:version="${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX}" -p:ContinuousIntegrationBuild=true
|
|
- name: .NET test
|
|
shell: bash
|
|
run: |
|
|
dotnet test
|
|
- name: NuGet publish
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
shell: bash
|
|
run: |
|
|
dotnet nuget push -k "${{ secrets.geekeey_package_registry }}" artifacts/package/release/shipping/*.nupkg |