Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

70 multi target #72

Merged
merged 15 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/dotnet-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: PUBLISH BETA

on:
workflow_dispatch:

pull_request:
types:
- closed
branches:
- 'development'
- 'dev/**'
- 'fix/**'
- 'bug/**'
- 'hotfix/**'
- 'feat/**'
- 'feature/**'

jobs:
build:
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest
outputs:
Version: ${{ steps.gitversion.outputs.SemVer }}
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 #fetch-depth is needed for GitVersion

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: 5.x

- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
id: gitversion

- name: Display GitVersion outputs
run: |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Dotnet Restore
run: dotnet restore ./source/**.sln

- name: Build Source Projects
run: dotnet build ./source/**.sln -p:Version='${{ steps.gitversion.outputs.SemVer }}' -c Release

- name: Pack NuGet Packages
run: dotnet pack ./source/**.sln -p:Version='${{ steps.gitversion.outputs.SemVer }}' -c Release -o bin/releasedFiles

- name: Publish Linux
run: dotnet publish ./source/Kangaroo.UI.Desktop/Kangaroo.UI.Desktop.csproj -c Release -r linux-x64 --self-contained true --framework net8.0 --output ./release/linux -p:PublishSingleFile="true" -p:Version='${{ steps.gitversion.outputs.SemVer }}'

- name: Publish Windows
run: dotnet publish .\source\Kangaroo.UI.Desktop\Kangaroo.UI.Desktop.csproj -c Release -r win-x86 --self-contained true --framework net8.0 --output ./release/windows -p:PublishSingleFile="true" -p:PublishReadyToRun="true" -p:Version='${{ steps.gitversion.outputs.SemVer }}'

- name: Archive Published Outputs
run: |
tar -czvf bin/releasedFiles/kangaroo_scanner_linux.zip -C ./release/linux .
tar -czvf bin/releasedFiles/kangaroo_scanner_windows.zip -C ./release/windows .

- name: Upload NuGet package to GitHub
uses: actions/upload-artifact@v4
with:
name: nugetPackage
path: bin/releasedFiles

release:
if: needs.build.outputs.CommitsSinceVersionSource > 0
runs-on: ubuntu-latest
needs: build

steps:
- name: Download nuget package artifact
uses: actions/download-artifact@v4
with:
name: nugetPackage
path: bin/releasedFiles

- name: Create Release
uses: ncipollo/[email protected]
with:
tag: ${{ needs.build.outputs.Version }}
name: Release ${{ needs.build.outputs.Version }}
body: Released via github actions workflow, see repository README.md
generateReleaseNotes: true
artifacts: "bin/releasedFiles/*"
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Push packages to Nuget
run: |
for file in $(find bin/releasedFiles -type f -name "*.nupkg"); do
echo $file
dotnet nuget push $file --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
done

97 changes: 97 additions & 0 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: PUBLISH RELEASE

on:
workflow_dispatch:

pull_request:
types: [closed]
branches: [main]

jobs:
build:
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest
outputs:
Version: ${{ steps.gitversion.outputs.SemVer }}
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 #fetch-depth is needed for GitVersion

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: 5.x

- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
id: gitversion

- name: Display GitVersion outputs
run: |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Dotnet Restore
run: dotnet restore ./source/**.sln

- name: Build Source Projects
run: dotnet build ./source/**.sln -p:Version='${{ steps.gitversion.outputs.SemVer }}' -c Release

- name: Pack NuGet Packages
run: dotnet pack ./source/**.sln -p:Version='${{ steps.gitversion.outputs.SemVer }}' -c Release -o bin/releasedFiles

- name: Publish Linux
run: dotnet publish ./source/Kangaroo.UI.Desktop/Kangaroo.UI.Desktop.csproj -c Release -r linux-x64 --self-contained true --framework net8.0 --output ./release/linux -p:PublishSingleFile="true" -p:Version='${{ steps.gitversion.outputs.SemVer }}'

- name: Publish Windows
run: dotnet publish .\source\Kangaroo.UI.Desktop\Kangaroo.UI.Desktop.csproj -c Release -r win-x86 --self-contained true --framework net8.0 --output ./release/windows -p:PublishSingleFile="true" -p:PublishReadyToRun="true" -p:Version='${{ steps.gitversion.outputs.SemVer }}'

- name: Archive Published Outputs
run: |
tar -czvf bin/releasedFiles/kangaroo_scanner_linux.zip -C ./release/linux .
tar -czvf bin/releasedFiles/kangaroo_scanner_windows.zip -C ./release/windows .

- name: Upload NuGet package to GitHub
uses: actions/upload-artifact@v4
with:
name: nugetPackage
path: bin/releasedFiles

release:
if: needs.build.outputs.CommitsSinceVersionSource > 0 && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build

steps:
- name: Download nuget package artifact
uses: actions/download-artifact@v4
with:
name: nugetPackage
path: bin/releasedFiles

- name: Create Release
uses: ncipollo/[email protected]
with:
tag: ${{ needs.build.outputs.Version }}
name: Release ${{ needs.build.outputs.Version }}
body: Released via github actions workflow, see repository README.md
generateReleaseNotes: true
artifacts: "bin/releasedFiles/*"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Push packages to Nuget
run: |
for file in $(find bin/releasedFiles -type f -name "*.nupkg"); do
echo $file
dotnet nuget push $file --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
done

33 changes: 33 additions & 0 deletions .github/workflows/dotnet-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: DOTNET TEST

on:

pull_request:
types: [opened, reopened, synchronize]
branches:
- "**"

jobs:
dotnet-test:

env:
BUILD_CONFIG: 'Release'
SOLUTION: './source/**.sln'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Restore dependencies
run: dotnet restore $SOLUTION

- name: Build Solution
run: dotnet build $SOLUTION --no-restore

- name: Test Solution
run: sudo dotnet test $SOLUTION --no-restore --verbosity normal
29 changes: 0 additions & 29 deletions .github/workflows/library.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/nuget.yaml

This file was deleted.

16 changes: 12 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
Expand Down Expand Up @@ -180,11 +178,9 @@ DocProject/Help/html
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
Expand Down Expand Up @@ -396,3 +392,15 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml
release/linux/Kangaroo Scanner
release/linux/Kangaroo.xml
release/linux/libe_sqlite3.so
release/linux/libHarfBuzzSharp.so
release/linux/libSkiaSharp.so
release/windows/av_libglesv2.dll
release/windows/e_sqlite3.dll
release/windows/Kangaroo Scanner.exe
release/windows/Kangaroo.xml
release/windows/kangaroo_scanner.db
release/windows/libHarfBuzzSharp.dll
release/windows/libSkiaSharp.dll
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,9 @@ Individual nodes can be queried as well.
var node = await scanner.CheckNetworkNode();
Console.WriteLine(node.Dump());
```

# Contributing
<a href="https://github.com/ewilliams0305/kangaroo/graphs/contributors">
<img src="https://contrib.rocks/image?repo=ewilliams0305/kangaroo" />
</a>

Loading
Loading