Skip to content

Commit

Permalink
Modernize build system to use GitHub Actions (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Mar 28, 2024
1 parent 96f58bd commit f38a8cd
Show file tree
Hide file tree
Showing 26 changed files with 362 additions and 860 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "11:00"

- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "11:00"
56 changes: 56 additions & 0 deletions .github/workflows/pr_validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: pr_validation

on:
push:
branches:
- master
- dev
- main
pull_request:
branches:
- master
- dev
- main

jobs:
test:
name: Test-${{matrix.os}}
runs-on: ${{matrix.os}}

strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: "Checkout"
uses: actions/[email protected]
with:
lfs: true
fetch-depth: 0

- name: "Install .NET SDK"
uses: actions/[email protected]
with:
global-json-file: "./global.json"

- name: "Update release notes"
shell: pwsh
run: |
./build.ps1
- name: "dotnet build"
run: dotnet build -c Release

# .NET Framework tests can't run reliably on Linux, so we only do .NET 8

- name: "dotnet test"
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
dotnet test -c Release --framework net8.0
else
dotnet test -c Release
fi
- name: "dotnet pack"
run: dotnet pack -c Release
52 changes: 52 additions & 0 deletions .github/workflows/publish_nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish NuGet

on:
push:
tags:
- '*'

jobs:
publish-nuget:

name: publish-nuget
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: "Update release notes"
shell: pwsh
run: |
./build.ps1
- name: Create Packages
run: dotnet pack /p:PackageVersion=${{ github.ref_name }} -c Release -o ./output

- name: Push Packages
run: dotnet nuget push "output/*.nupkg" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json

- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: 'Akka.Persistence.EventStore ${{ github.ref_name }}'
tag_name: ${{ github.ref }}
body_path: RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload Release Asset
uses: AButler/[email protected]
with:
repo-token: ${{ github.token }}
release-tag: ${{ github.ref_name }}
files: 'output/*.nupkg'
33 changes: 29 additions & 4 deletions Akka.Persistence.EventStore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,32 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.EventStore
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.EventStore.Tests", "src\Akka.Persistence.EventStore.Tests\Akka.Persistence.EventStore.Tests.csproj", "{D6605D9E-9866-429C-AD8F-EEDC8104DEEB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{2842D2F3-7B85-476F-974E-1950C34B698C}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{F4AC94E7-D5F3-4B85-9810-A8BF02441883}"
ProjectSection(SolutionItems) = preProject
build.cmd = build.cmd
build.fsx = build.fsx
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
global.json = global.json
nuget.config = nuget.config
build.ps1 = build.ps1
build.sh = build.sh
README.md = README.md
RELEASE_NOTES.md = RELEASE_NOTES.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{96349315-C6BE-4888-B81A-9A46EF7CE685}"
ProjectSection(SolutionItems) = preProject
scripts\bumpVersion.ps1 = scripts\bumpVersion.ps1
scripts\getReleaseNotes.ps1 = scripts\getReleaseNotes.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{DF2C9C02-9F0D-4FC8-8F72-234FD68FC918}"
ProjectSection(SolutionItems) = preProject
.github\dependabot.yaml = .github\dependabot.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{6017AE31-4718-413B-983E-EAF9D4B465C9}"
ProjectSection(SolutionItems) = preProject
.github\workflows\pr_validation.yaml = .github\workflows\pr_validation.yaml
.github\workflows\publish_nuget.yml = .github\workflows\publish_nuget.yml
EndProjectSection
EndProject
Global
Expand Down Expand Up @@ -70,4 +90,9 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A606AD52-05AA-47CF-B84B-2CD1F880A183}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{96349315-C6BE-4888-B81A-9A46EF7CE685} = {F4AC94E7-D5F3-4B85-9810-A8BF02441883}
{DF2C9C02-9F0D-4FC8-8F72-234FD68FC918} = {F4AC94E7-D5F3-4B85-9810-A8BF02441883}
{6017AE31-4718-413B-983E-EAF9D4B465C9} = {DF2C9C02-9F0D-4FC8-8F72-234FD68FC918}
EndGlobalSection
EndGlobal
41 changes: 41 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Project>
<PropertyGroup>
<Copyright>Copyright © 2013-2024 Akka.NET Project</Copyright>
<NoWarn>$(NoWarn);CS1591;NU1701;CA1707;</NoWarn>
<VersionPrefix>1.4.0</VersionPrefix>
<Authors>Akka.NET Team</Authors>
<PackageProjectUrl>https://github.com/akkadotnet/Akka.Persistence.EventStore</PackageProjectUrl>
<PackageReleaseNotes>Serialization changes to match 1.4 API
Upgrade to Akka 1.4 dependency
Upgrade to EventStore 5 dependency
netstandard2 and netfx452 (from netstandard1.6 and netfx45)

**Breaking Changes**
EventAdapter interface change (see README)</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageIcon>logo.png</PackageIcon>
</PropertyGroup>
<PropertyGroup>
<NetLibraryVersion>netstandard2.0</NetLibraryVersion>
<NetFrameworkVersion>net452</NetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Label="Build">
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\logo.png" Pack="true" Visible="false" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)\README.md" Pack="true" Visible="false" PackagePath="\" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkVersion)' ">
<DefineConstants>$(DefineConstants);SERIALIZATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == '$(NetLibraryVersion)' ">
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>
</Project>
32 changes: 32 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<AkkaVersion>1.4.0-beta1</AkkaVersion>
<NBenchVersion>1.2.2</NBenchVersion>
<XunitVersion>2.4.1</XunitVersion>
<TestSdkVersion>15.9.0</TestSdkVersion>
</PropertyGroup>
<!-- Akka.NET Package Versions -->
<ItemGroup>
<PackageVersion Include="Akka.Hosting" Version="1.5.6.1" />
<PackageVersion Include="NuGet.Frameworks" Version="6.9.1" />
<PackageVersion Include="Akka" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Persistence" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Persistence.Query" Version="$(AkkaVersion)" />
<PackageVersion Include="EventStore.Client" Version="[5.0.0,)" />
</ItemGroup>
<!-- Testing Utilities -->
<ItemGroup>
<PackageVersion Include="Akka.Persistence.TCK" Version="$(AkkaVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="2.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="Docker.DotNet" Version="3.125.12" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
</ItemGroup>
</Project>
8 changes: 0 additions & 8 deletions build-system/README.md

This file was deleted.

55 changes: 0 additions & 55 deletions build-system/azure-pipeline.template.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions build-system/linux-pr-validation.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions build-system/nightly-builds.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions build-system/windows-pr-validation.yaml

This file was deleted.

Loading

0 comments on commit f38a8cd

Please sign in to comment.