Skip to content

Commit

Permalink
Modernize CI/CD scripts (#151)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Arkatufus authored Dec 20, 2024
1 parent 86a4760 commit 79f6476
Show file tree
Hide file tree
Showing 25 changed files with 214 additions and 1,340 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/Windows_release.yml

This file was deleted.

84 changes: 50 additions & 34 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,46 +30,62 @@ jobs:
windows-latest:
name: windows-latest
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Make build.sh executable
run: chmod +x ./build.sh
- name: Make build.cmd executable
run: chmod +x ./build.cmd
- uses: actions/setup-dotnet@v1
- name: "Checkout"
uses: actions/[email protected]
with:
dotnet-version: 6.0.*
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v2
lfs: true
fetch-depth: 0

- name: "Install .NET SDK"
uses: actions/[email protected]
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Run './build.cmd All'
run: ./build.cmd All
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
global-json-file: "./global.json"

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

- name: "dotnet test"
shell: bash
run: dotnet test -c Release

- name: "dotnet pack"
run: dotnet pack -c Release -o ./bin/nuget

ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Make build.sh executable
run: chmod +x ./build.sh
- name: Make build.cmd executable
run: chmod +x ./build.cmd
- uses: actions/setup-dotnet@v1
- name: "Checkout"
uses: actions/[email protected]
with:
dotnet-version: 6.0.*
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v2
lfs: true
fetch-depth: 0

- name: "Install .NET SDK"
uses: actions/[email protected]
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Run './build.cmd All'
run: ./build.cmd All
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 Core
- name: "dotnet test"
shell: bash
run: dotnet test -c Release -f net6.0

- name: "dotnet pack"
run: dotnet pack -c Release -o ./bin/nuget
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.TestKit.NUnit ${{ 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'
167 changes: 0 additions & 167 deletions .nuke/build.schema.json

This file was deleted.

4 changes: 0 additions & 4 deletions .nuke/parameters.json

This file was deleted.

4 changes: 0 additions & 4 deletions Akka.TestKit.Nunit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.TestKit.NUnit3", "src\
EndProject
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}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{637FF340-E344-4119-8E64-FE105974B754}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{873747EF-ACF9-4BB2-90C1-052BFA3C84F2}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
Expand Down Expand Up @@ -41,8 +39,6 @@ Global
{FF91B397-1E60-4B94-99A1-B534C7BB91A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF91B397-1E60-4B94-99A1-B534C7BB91A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF91B397-1E60-4B94-99A1-B534C7BB91A5}.Release|Any CPU.Build.0 = Release|Any CPU
{637FF340-E344-4119-8E64-FE105974B754}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{637FF340-E344-4119-8E64-FE105974B754}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 79f6476

Please sign in to comment.