Skip to content

Commit

Permalink
Added: Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Jun 20, 2024
1 parent b1fa528 commit 3378df2
Show file tree
Hide file tree
Showing 5 changed files with 546 additions and 0 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Test Build and Package .NET Library with Native Binaries

on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'action.yml'
- '.github/workflows/test-action.yml'
tags:
- 'v1'
- 'v1-test'
pull_request:
branches: [ main ]
paths:
- 'action.yml'
- '.github/workflows/test-action.yml'

jobs:
test-action:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: i686-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: ubuntu-latest
target: x86_64-linux-android
- os: ubuntu-latest
target: aarch64-linux-android
- os: ubuntu-latest
target: armv7-linux-androideabi
- os: ubuntu-latest
target: i686-linux-android
- os: macos-latest
target: aarch64-apple-ios
- os: macos-latest
target: x86_64-apple-ios
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Test Repository
uses: actions/checkout@v4
with:
repository: Sewer56/prs-rs
ref: d08599ed5473616f57d57a0966939e1a5dbda9b4
path: test-repo

- name: Build C Library
uses: Reloaded-Project/devops-rust-lightweight-binary@v1
with:
crate-name: prs-rs
target: ${{ matrix.target }}
features: c-exports
build-library: true

- name: Build and Package .NET Library
uses: Reloaded-Project/devops-rust-c-library-to-dotnet@v1
with:
targets: ${{ matrix.target }}
csharp-project-path: test-repo/bindings/csharp
install-dotnet: true

- name: Upload NuGet Package
uses: actions/upload-artifact@v4
with:
name: NuGet-Package-${{ matrix.target }}
path: |
test-repo/bindings/csharp/nupkg/*.nupkg
test-repo/bindings/csharp/nupkg/*.snupkg
verify-nuget-packages:
needs: test-action
runs-on: ubuntu-latest
steps:
- name: Download NuGet Packages
uses: actions/download-artifact@v4
with:
name: NuGet-Package-*
path: nuget-packages

- name: Assert NuGet Packages Exist
shell: bash
run: |
if [ -z "$(ls -A nuget-packages)" ]; then
echo "No NuGet packages found in the 'nuget-packages' directory"
exit 1
fi
echo "NuGet packages exist in the 'nuget-packages' directory"
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2023 Sewer56

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 3378df2

Please sign in to comment.