Skip to content

Commit 79f6476

Browse files
authored
Modernize CI/CD scripts (#151)
* Update CI/CD scripts * Add global.json file, targets .NET 6.0 SDK * Remove NUKE project * Make CI/CD run purely on GitHub Actions, mimic Akka.Hosting setup * Move Directory.Build.props file to root * Add Directory.Generated.props file to root * Change RELEASE_NOTES.md file format to match Akka.Hosting format * Update global.json
1 parent 86a4760 commit 79f6476

25 files changed

+214
-1340
lines changed

.github/workflows/Windows_release.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/pr_validation.yml

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -30,46 +30,62 @@ jobs:
3030
windows-latest:
3131
name: windows-latest
3232
runs-on: windows-latest
33+
3334
steps:
34-
- uses: actions/checkout@v2
35-
- name: Make build.sh executable
36-
run: chmod +x ./build.sh
37-
- name: Make build.cmd executable
38-
run: chmod +x ./build.cmd
39-
- uses: actions/setup-dotnet@v1
35+
- name: "Checkout"
36+
uses: actions/[email protected]
4037
with:
41-
dotnet-version: 6.0.*
42-
- name: Cache .nuke/temp, ~/.nuget/packages
43-
uses: actions/cache@v2
38+
lfs: true
39+
fetch-depth: 0
40+
41+
- name: "Install .NET SDK"
42+
uses: actions/[email protected]
4443
with:
45-
path: |
46-
.nuke/temp
47-
~/.nuget/packages
48-
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
49-
- name: Run './build.cmd All'
50-
run: ./build.cmd All
51-
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
global-json-file: "./global.json"
45+
46+
- name: "Update release notes"
47+
shell: pwsh
48+
run: |
49+
./build.ps1
50+
51+
- name: "dotnet build"
52+
run: dotnet build -c Release
53+
54+
- name: "dotnet test"
55+
shell: bash
56+
run: dotnet test -c Release
57+
58+
- name: "dotnet pack"
59+
run: dotnet pack -c Release -o ./bin/nuget
60+
5361
ubuntu-latest:
5462
name: ubuntu-latest
5563
runs-on: ubuntu-latest
64+
5665
steps:
57-
- uses: actions/checkout@v2
58-
- name: Make build.sh executable
59-
run: chmod +x ./build.sh
60-
- name: Make build.cmd executable
61-
run: chmod +x ./build.cmd
62-
- uses: actions/setup-dotnet@v1
66+
- name: "Checkout"
67+
uses: actions/[email protected]
6368
with:
64-
dotnet-version: 6.0.*
65-
- name: Cache .nuke/temp, ~/.nuget/packages
66-
uses: actions/cache@v2
69+
lfs: true
70+
fetch-depth: 0
71+
72+
- name: "Install .NET SDK"
73+
uses: actions/[email protected]
6774
with:
68-
path: |
69-
.nuke/temp
70-
~/.nuget/packages
71-
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
72-
- name: Run './build.cmd All'
73-
run: ./build.cmd All
74-
env:
75-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
global-json-file: "./global.json"
76+
77+
- name: "Update release notes"
78+
shell: pwsh
79+
run: |
80+
./build.ps1
81+
82+
- name: "dotnet build"
83+
run: dotnet build -c Release
84+
85+
# .NET Framework tests can't run reliably on Linux, so we only do .NET Core
86+
- name: "dotnet test"
87+
shell: bash
88+
run: dotnet test -c Release -f net6.0
89+
90+
- name: "dotnet pack"
91+
run: dotnet pack -c Release -o ./bin/nuget

.github/workflows/publish_nuget.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish-nuget:
10+
11+
name: publish-nuget
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Setup .NET Core
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: ${{ env.DOTNET_VERSION }}
23+
24+
- name: "Update release notes"
25+
shell: pwsh
26+
run: |
27+
./build.ps1
28+
29+
- name: Create Packages
30+
run: dotnet pack /p:PackageVersion=${{ github.ref_name }} -c Release -o ./output
31+
32+
- name: Push Packages
33+
run: dotnet nuget push "output/*.nupkg" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
34+
35+
- name: release
36+
uses: actions/create-release@v1
37+
id: create_release
38+
with:
39+
draft: false
40+
prerelease: false
41+
release_name: 'Akka.TestKit.NUnit ${{ github.ref_name }}'
42+
tag_name: ${{ github.ref }}
43+
body_path: RELEASE_NOTES.md
44+
env:
45+
GITHUB_TOKEN: ${{ github.token }}
46+
47+
- name: Upload Release Asset
48+
uses: AButler/[email protected]
49+
with:
50+
repo-token: ${{ github.token }}
51+
release-tag: ${{ github.ref_name }}
52+
files: 'output/*.nupkg'

.nuke/build.schema.json

Lines changed: 0 additions & 167 deletions
This file was deleted.

.nuke/parameters.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

Akka.TestKit.Nunit.sln

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.TestKit.NUnit3", "src\
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.TestKit.NUnit3.Tests", "src\Akka.TestKit.NUnit3.Tests\Akka.TestKit.NUnit3.Tests.csproj", "{FF91B397-1E60-4B94-99A1-B534C7BB91A5}"
1313
EndProject
14-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{637FF340-E344-4119-8E64-FE105974B754}"
15-
EndProject
1614
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{873747EF-ACF9-4BB2-90C1-052BFA3C84F2}"
1715
ProjectSection(SolutionItems) = preProject
1816
README.md = README.md
@@ -41,8 +39,6 @@ Global
4139
{FF91B397-1E60-4B94-99A1-B534C7BB91A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
4240
{FF91B397-1E60-4B94-99A1-B534C7BB91A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
4341
{FF91B397-1E60-4B94-99A1-B534C7BB91A5}.Release|Any CPU.Build.0 = Release|Any CPU
44-
{637FF340-E344-4119-8E64-FE105974B754}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45-
{637FF340-E344-4119-8E64-FE105974B754}.Release|Any CPU.ActiveCfg = Release|Any CPU
4642
EndGlobalSection
4743
GlobalSection(SolutionProperties) = preSolution
4844
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)