Add CI
This commit is contained in:
31
.github/workflows/build.yml
vendored
Normal file
31
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: '8.0.x'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: dotnet build --configuration Release
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: dotnet test --configuration Release --no-build
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Build
|
||||||
|
path: ${{ github.workspace }}
|
||||||
38
.github/workflows/release.yml
vendored
Normal file
38
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: '8.0.x'
|
||||||
|
|
||||||
|
- name: Verify commit exists in origin/master
|
||||||
|
run: |
|
||||||
|
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
||||||
|
git branch --remote --contains | grep origin/master
|
||||||
|
|
||||||
|
- name: Set VERSION variable from tag
|
||||||
|
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: dotnet build --configuration Release /p:Version=${VERSION}
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
|
||||||
|
|
||||||
|
- name: Pack
|
||||||
|
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: dotnet nuget push CSSUDII.Sodium.Interop.${VERSION}.nupkg --source https://nexus.119.224.65.18.sslip.io/repository/nuget/index.json --api-key ${GITHUB_TOKEN}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
--file-directory
|
--file-directory
|
||||||
D:/usr/include/
|
E:/Downloads/libsodium/include
|
||||||
|
|
||||||
--config
|
--config
|
||||||
generate-helper-types
|
generate-helper-types
|
||||||
@@ -82,10 +82,10 @@ sodium/utils.h
|
|||||||
sodium/version.h
|
sodium/version.h
|
||||||
|
|
||||||
--namespace
|
--namespace
|
||||||
SpaceWizards.Sodium.Interop
|
CSSUDII.Sodium.Interop
|
||||||
|
|
||||||
--output
|
--output
|
||||||
SpaceWizards.Sodium.Interop/Generated
|
CSSUDII.Sodium.Interop/Generated
|
||||||
|
|
||||||
--libraryPath
|
--libraryPath
|
||||||
libsodium
|
libsodium
|
||||||
|
|||||||
Reference in New Issue
Block a user