Skip to content

Kryptor CI

Kryptor CI #35

Workflow file for this run

name: Kryptor CI
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'test/**'
branches: [master, dev]
pull_request:
branches: [master]
permissions:
checks:
write
contents:
write
packages:
write
pull-requests:
write
defaults:
run:
shell: bash
jobs:
dotnet:
strategy:
matrix:
os: [ubuntu]
configuration: [Nuget]
name: Build ${{ matrix.configuration }} Configuration on ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
cache: true
cache-dependency-path: '**/packages.lock.json'
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: |
./build.sh --bootstrap
- name: Build
run: |
./build.sh -t build-all -c ${{ matrix.configuration }}
shell: bash
- name: Test
run: |
./build.sh -t test-all -c ${{ matrix.configuration }}
shell: bash
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: matrix.os == 'ubuntu' && matrix.configuration == 'Nuget'
with:
files: |
**/TestResults/*.trx
- name: Codecov
uses: codecov/codecov-action@v4
if: env.CODECOV_TOKEN != '' && matrix.os == 'ubuntu' && matrix.configuration == 'Nuget'
env:
CODECOV_TOKEN: ${{ env.CODECOV_TOKEN }}
- name: Create NuGet package
if: github.event_name != 'pull_request'
run: |
./build.sh -t pack-all -c ${{ matrix.configuration }} -o __out__
shell: bash
- name: Deploy to Github packages
continue-on-error: true
run: |
for TARGET in __out__/*.*nupkg
do
dotnet nuget push $TARGET --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --skip-duplicate || continue
done
shell: bash
- name: Deploy to NuGet gallery
continue-on-error: true
run: |
for TARGET in __out__/*.*nupkg
do
dotnet nuget push $TARGET --api-key ${{ secrets.NUGET_API_KEY }} --source "nuget.org" --skip-duplicate || continue
done
shell: bash