Skip to content

Commit 67e641f

Browse files
MarcellvanRooyenAlexander Ovchinnikov
authored and
Alexander Ovchinnikov
committed
Add Mendix GitHub pipeline
* Use Mendix.LibGit2Sharp.NativeBinaries Co-authored-by: Marcell van Rooyen <[email protected]>
1 parent 8c32b61 commit 67e641f

File tree

4 files changed

+48
-110
lines changed

4 files changed

+48
-110
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Deploy Packages
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: windows-2022
12+
13+
steps:
14+
# Checkout repo into build area
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0 # avoid shallow clone
18+
19+
# Build and deploy nuget package
20+
# We include the GitHub package source so that we can reference current packages and also so that we can push to the package repo
21+
- name: Build Project and Package
22+
env:
23+
MINVERVERSIONOVERRIDE: '1.164.0'
24+
run: |
25+
dotnet nuget add source "https://nuget.pkg.github.com/mendix/index.json" --name "GitHub" --username ${{ secrets.GHPACKAGESUSER }} --password ${{ secrets.GHPACKAGESTOKEN }}
26+
dotnet pack --configuration Release --output "mx_nuget" LibGit2Sharp/LibGit2Sharp.csproj
27+
shell: powershell # Keep as powershell and not pwsh
28+
29+
- name: Upload build artifacts
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: nuget package
33+
path: ${{ github.workspace }}/**/*.nupkg
34+
35+
# After build we copy the binaries to package output folder
36+
# Finally we pack and push the package to github packages
37+
- name: Deploy Package
38+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
39+
run: |
40+
dotnet nuget add source "https://nuget.pkg.github.com/mendix/index.json" --name "GitHub" --username ${{ secrets.GHPACKAGESUSER }} --password ${{ secrets.GHPACKAGESTOKEN }}
41+
dotnet nuget push "**/mx_nuget/Mendix.LibGit2Sharp*.nupkg" --source "GitHub" --skip-duplicate
42+
shell: powershell # Keep as powershell and not pwsh

.github/workflows/ci.yml

-91
This file was deleted.

.mailmap

-8
This file was deleted.

LibGit2Sharp/LibGit2Sharp.csproj

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>net472;net6.0</TargetFrameworks>
@@ -15,13 +15,14 @@
1515
<SignAssembly>true</SignAssembly>
1616
<AssemblyOriginatorKeyFile>..\libgit2sharp.snk</AssemblyOriginatorKeyFile>
1717
<PackageIcon>square-logo.png</PackageIcon>
18-
<PackageReadmeFile>App_Readme/README.md</PackageReadmeFile>
1918
<PackageLicenseFile>App_Readme/LICENSE.md</PackageLicenseFile>
20-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
21-
<MinVerDefaultPreReleaseIdentifiers>preview.0</MinVerDefaultPreReleaseIdentifiers>
2219
<MinVerBuildMetadata Condition="'$(libgit2_hash)' != ''">libgit2-$(libgit2_hash.Substring(0,7))</MinVerBuildMetadata>
2320
</PropertyGroup>
2421

22+
<PropertyGroup>
23+
<PackageId>Mendix.LibGit2Sharp</PackageId>
24+
</PropertyGroup>
25+
2526
<ItemGroup>
2627
<None Include="..\square-logo.png" Pack="true" PackagePath="" Visible="false" />
2728
<None Include="..\README.md" Pack="true" PackagePath="App_Readme/" Visible="false" />
@@ -33,20 +34,14 @@
3334
</ItemGroup>
3435

3536
<ItemGroup>
36-
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[2.0.320]" PrivateAssets="none" />
37+
<PackageReference Include="Mendix.LibGit2Sharp.NativeBinaries" Version="[1.164.0]" PrivateAssets="none" />
3738
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
3839
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="all" />
3940
</ItemGroup>
4041

4142
<Import Project="..\Targets\CodeGenerator.targets" />
4243
<Import Project="..\Targets\GenerateNativeDllName.targets" />
4344

44-
<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec">
45-
<PropertyGroup>
46-
<PackageReleaseNotes>https://github.com/libgit2/libgit2sharp/blob/$(SourceRevisionId)/CHANGES.md</PackageReleaseNotes>
47-
</PropertyGroup>
48-
</Target>
49-
5045
<Target Name="AdjustVersions" AfterTargets="MinVer">
5146
<PropertyGroup>
5247
<AssemblyVersion>$(MinVerMajor).$(MinVerMinor).0.0</AssemblyVersion>

0 commit comments

Comments
 (0)