Skip to content

Commit

Permalink
adjusted build script
Browse files Browse the repository at this point in the history
  • Loading branch information
eugstman committed Dec 1, 2021
1 parent fa8f46e commit 6d35bbc
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 90 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/integration_build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: .NET
name: .NET Integration build

on:
push:
branches:
- master
tags:
- v
pull_request:
branches:
- master
Expand Down Expand Up @@ -55,3 +50,12 @@ jobs:
- name: dotnet Test
run: dotnet test -c Release --no-build --verbosity normal ./src/Homey.Net.sln

- name: Pack Nuget
run: dotnet pack src/Homey.Net/Homey.Net.csproj -c Release -o publish /p:Version=${{ env.GitVersion.NuGetVersion }}

- name: Upload artefact
uses: actions/upload-artifact@v2
with:
name: "Homey.Net_${{ env.GitVersion.NuGetVersion }}"
path: src/**/*.nupkg
if-no-files-found: error
68 changes: 68 additions & 0 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: .NET Release build

on:
push:
branches:
- master
tags:
- v

jobs:
build:
name: Build
runs-on: windows-latest

steps:

- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: ./.github/Gitversion.yml

- name: Display GitVersion outputs
run: |
echo "Major: ${{ env.GitVersion_SemVer }}"
echo "Major: ${{ env.GitVersion_Major }}"
echo "Minor: ${{ env.GitVersion_Minor }}"
echo "Patch: ${{ env.GitVersion_Patch }}"
echo "AssemblySemVer: ${{ env.GitVersion_AssemblySemVer }}"
echo "AssemblySemFileVer: ${{ env.GitVersion_AssemblySemFileVer }}"
- name: dotnet restore
run: dotnet restore ./src/Homey.Net.sln

- name: dotnet Build
run: dotnet build -c Release -p:Version=${{ env.GitVersion_AssemblySemVer }} --no-restore ./src/Homey.Net.sln

- name: dotnet Test
run: dotnet test -c Release --no-build --verbosity normal ./src/Homey.Net.sln

- name: Pack Nuget
run: dotnet pack src/Homey.Net/Homey.Net.csproj -c Release -o publish /p:Version=${{ env.GitVersion.NuGetVersion }}

- name: Upload artefact
uses: actions/upload-artifact@v2
with:
name: "Homey.Net_${{ env.GitVersion.NuGetVersion }}"
path: src/**/*.nupkg
if-no-files-found: error

- name: Push generated package to GitHub registry
run: dotnet nuget push src/Homey.Net/publish/*.nupkg --api-key ${NUGET_ORG_TOKEN} --source https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols true
env:
GITHUB_TOKEN: ${{ secrets.NUGET_ORG_TOKEN }}
84 changes: 0 additions & 84 deletions build/release_build.yml

This file was deleted.

0 comments on commit 6d35bbc

Please sign in to comment.