Skip to content

Commit

Permalink
Merge pull request #4 from praeclarum/ci
Browse files Browse the repository at this point in the history
Create build.yml
  • Loading branch information
praeclarum authored Sep 1, 2022
2 parents be487a1 + b342efe commit 9af0951
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 15 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Test and Package

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

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Update Versions
env:
VERSION_PREFIX: 0.8
VERSION_SUFFIX: ${{github.run_number}}
run: |
VERSION=$VERSION_PREFIX.$VERSION_SUFFIX
sed -i "s:<Version>1.0.0</Version>:<Version>$VERSION</Version>:g" Cli/Cli.csproj
sed -i "s:<Version>1.0.0</Version>:<Version>$VERSION</Version>:g" Iril/Iril.csproj
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.400
- name: Install ILSpy
run: dotnet tool install ilspycmd -g
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: |
cd Tests
dotnet test -c Release --no-build --verbosity normal
- name: Package
run: |
mkdir PackageOut
cd Cli
dotnet pack -c Release
cp bin/Release/*.nupkg ../PackageOut
- name: Upload Package
uses: actions/upload-artifact@master
with:
path: PackageOut
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/PackageOut

/*.nupkg
/y.output
/*.c
Expand Down Expand Up @@ -60,3 +62,5 @@ Thumbs.db

# dotCover
*.dotCover

.fake
12 changes: 6 additions & 6 deletions Cli/Cli.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\Iril\Iril.csproj" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<Version>0.6</Version>
<Version>1.0.0</Version>
<Authors>praeclarum</Authors>
<Description>Compiles LLVM IR, C, and C++ code to .NET Standard assemblies.</Description>
<PackageTags>C;C++;LLVM;IR;Compiler;Native;PInvoke</PackageTags>
Expand All @@ -19,6 +15,10 @@
<ToolCommandName>iril</ToolCommandName>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Iril\Iril.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>
Expand Down
10 changes: 3 additions & 7 deletions Iril/Iril.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.0.0</Version>
<LangVersion>latest</LangVersion>
<PreBuildEvent Condition="$(HOME.StartsWith('/Users/fak'))">cd /Users/fak/Dropbox/Projects/Iril &amp;&amp; make</PreBuildEvent>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<LangVersion>8.0</LangVersion>
</PropertyGroup>

<ItemGroup>
<Folder Include="IR\" />
<Folder Include="Types\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.10.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -16,7 +16,7 @@
<PackageReference Include="nunit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="Mono.Cecil" Version="0.10.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "6.0.400"
}
}

0 comments on commit 9af0951

Please sign in to comment.