Skip to content

Commit

Permalink
Merge pull request #179 from neurogears/release-automation
Browse files Browse the repository at this point in the history
Add build CI workflow with package artifacts
  • Loading branch information
glopesdev authored Jul 31, 2024
2 parents e8add7f + 259cd20 commit 9347ce3
Show file tree
Hide file tree
Showing 101 changed files with 97 additions and 20 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
ContinuousIntegrationBuild: true
CiRunNumber: ${{ github.run_number }}
CiRunPushSuffix: ${{ github.ref_name }}-ci${{ github.run_number }}
CiRunPullSuffix: pull-${{ github.event.number }}-ci${{ github.run_number }}
jobs:
build:
strategy:
fail-fast: false
matrix:
configuration: [debug, release]
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
configuration: release
collect-packages: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Restore
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration ${{ matrix.configuration }}

- name: Pack
id: pack
if: matrix.collect-packages
env:
CiBuildVersionSuffix: ${{ github.event_name == 'push' && env.CiRunPushSuffix || env.CiRunPullSuffix }}
run: dotnet pack --no-build --configuration ${{ matrix.configuration }}

- name: Collect packages
uses: actions/upload-artifact@v4
if: matrix.collect-packages && steps.pack.outcome == 'success' && always()
with:
name: Packages
if-no-files-found: error
path: artifacts/package/${{matrix.configuration}}/**
14 changes: 6 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.vs
bin
obj
Packages
*.user
*.exe
*.exe.settings
*.exe.WebView2
.vs/
/artifacts/
.bonsai/Packages/
.bonsai/*.exe
.bonsai/*.exe.settings
.bonsai/*.exe.WebView2/
18 changes: 11 additions & 7 deletions OpenEphys.Onix/Directory.Build.props → Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
<PropertyGroup>
<Authors>Open Ephys</Authors>
<Copyright>Copyright © Open Ephys and Contributors 2024</Copyright>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageOutputPath>..\bin\$(Configuration)</PackageOutputPath>
<PackageProjectUrl></PackageProjectUrl>
<IncludeSymbols Condition="'$(Configuration)'=='Release'">true</IncludeSymbols>
<GeneratePackageOnBuild Condition="'$(Configuration)'=='Release'">true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols>true</IncludeSymbols>
<RepositoryUrl></RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<UseArtifactsOutput>true</UseArtifactsOutput>
<PackageIcon>icon.png</PackageIcon>
<VersionPrefix>0.1.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<LangVersion>9.0</LangVersion>
<Features>strict</Features>
</PropertyGroup>

<Import Project="build/Version.props" />

<ItemGroup>
<Content Include="..\..\LICENSE" PackagePath="/" />
<Content Include="..\..\icon.png" PackagePath="/" />
<Content Include="..\LICENSE" PackagePath="/" />
<Content Include="..\icon.png" PackagePath="/" />
<Content Include="..\README.md" PackagePath="/" />
</ItemGroup>
</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Title>OpenEphys.Onix.Design</Title>
<Description>Bonsai Library containing visual interfaces for configuring ONIX devices.</Description>
<PackageTags>Bonsai Rx Open Ephys Onix Design</PackageTags>
<TargetFramework>net472</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<VersionPrefix>0.1.0</VersionPrefix>
<IsPackable>false</IsPackable>
<Platforms>x64</Platforms>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Bonsai": {
"commandName": "Executable",
"executablePath": "$(SolutionDir)..\\Bonsai\\Bonsai.exe",
"executablePath": "$(SolutionDir).bonsai/Bonsai.exe",
"commandLineArgs": "--lib:$(TargetDir).",
"nativeDebugging": true
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PackageTags>Bonsai Rx Open Ephys Onix</PackageTags>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<VersionPrefix>0.1.0</VersionPrefix>
<Platforms>x64</Platforms>
</PropertyGroup>

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Bonsai": {
"commandName": "Executable",
"executablePath": "$(SolutionDir)..\\Bonsai\\Bonsai.exe",
"executablePath": "$(SolutionDir).bonsai/Bonsai.exe",
"commandLineArgs": "--lib:$(TargetDir).",
"nativeDebugging": true
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions build/Version.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project>
<PropertyGroup Condition="'$(ContinuousIntegrationBuild)' != 'true'">
<!-- When making local builds DevVersion can be overridden to generate multiple local versions -->
<DevVersion Condition="'$(DevVersion)' == ''">0</DevVersion>

<VersionSuffix>dev$(DevVersion)</VersionSuffix>
<_FileVersionRevision>$([MSBuild]::Add(60000, $(DevVersion)))</_FileVersionRevision>
</PropertyGroup>

<PropertyGroup Condition="'$(ContinuousIntegrationBuild)' == 'true'">
<VersionSuffix>$(CiBuildVersionSuffix)</VersionSuffix>
<_FileVersionRevision>0</_FileVersionRevision>
<_FileVersionRevision Condition="'$(CiBuildVersionSuffix)' != '' and '$(CiRunNumber)' != ''">$(CiRunNumber)</_FileVersionRevision>
</PropertyGroup>

<PropertyGroup>
<!-- Force malformed versions to be an error -->
<WarningsAsErrors>$(WarningsAsErrors);CS7035</WarningsAsErrors>
</PropertyGroup>
</Project>

0 comments on commit 9347ce3

Please sign in to comment.