Skip to content

Commit

Permalink
Create build.yml (#29)
Browse files Browse the repository at this point in the history
Moved to github actions
  • Loading branch information
ckuetbach authored Apr 12, 2024
1 parent 801bdbd commit 267cc73
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 53 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Build and Test Solution"
description: "Checks out the repository and does something"
runs:
using: "composite"
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
shell: bash
run: dotnet restore
- name: Build
shell: bash
run: dotnet build --no-restore
- name: Test
shell: bash
run: dotnet test --no-build --verbosity normal
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: "Build & Test"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: ./.github/workflows/build-action
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: "Publish to nuget.org"

on:
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: ./.github/workflows/build-action
- name: Create Version
run: echo "VERSION=$(grep -oPm1 "(?<=<VersionPrefix>)[^<]+" ./Directory.Build.props)" >> $GITHUB_ENV
- name: Print Version
run: echo ${{ env.VERSION }}
- if: ${{startsWith(github.event.ref, 'refs/tags/v')}}
name: Publish Release NuGet
run: |
dotnet build -c Release
dotnet pack -c Release /p:Version=${{ env.VERSION }}.${{ github.run_number }} /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}"
dotnet nuget push "**/*.${{ env.VERSION }}.${{ github.run_number }}.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_PUSH}} --skip-duplicate
- if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
name: Publish Prerelease NuGet
run: |
dotnet pack -c Debug /p:Version=${{ env.VERSION }}.${{ github.run_number }}-prerelease /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}"
dotnet nuget push "**/*.${{ env.VERSION }}.${{ github.run_number }}-prerelease.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_PUSH}} --skip-duplicate
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<Company>d.velop AG</Company>
<Copyright>Copyright (c) 2021</Copyright>
<PackageProjectUrl>https://github.com/d-velop/dvelop-sdk-cs</PackageProjectUrl>
<VersionPrefix>0.0.7</VersionPrefix>
<VersionPrefix>0.0.8</VersionPrefix>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Dvelop.Sdk.HttpClientExtensions.UnitTest</AssemblyName>
<RootNamespace>Dvelop.Sdk.HttpClientExtensions.UnitTest</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Dvelop.Sdk.IdentityProviderMiddleware.UnitTest</AssemblyName>
<RootNamespace>Dvelop.Sdk.IdentityProviderMiddleware.UnitTest</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Dvelop.Sdk.SigningAlgorithms.UnitTest</AssemblyName>
<RootNamespace>Dvelop.Sdk.SigningAlgorithms.UnitTest</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Dvelop.Sdk.TenantMiddleware.UnitTest</AssemblyName>
<RootNamespace>Dvelop.Sdk.TenantMiddleware.UnitTest</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>

Expand Down
37 changes: 0 additions & 37 deletions travis/deploy.sh

This file was deleted.

0 comments on commit 267cc73

Please sign in to comment.