Skip to content

Commit

Permalink
added build pipelines in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed May 26, 2024
1 parent 027eda2 commit d7411c2
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 11 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Set env
run: |
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV
echo "DOTNET_hostBuilder:reloadConfigOnChange=false" >> $GITHUB_ENV
- name: Clean
run: |
dotnet clean ./NetInteractor.sln
dotnet nuget locals all --clear
- name: Build
run: dotnet build -c Release
- name: Test
run: |
cd test/NetInteractor.Test
dotnet test
24 changes: 24 additions & 0 deletions .github/workflows/myget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: myget

on:
push:
branches:
- master

jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Set env
run: echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV
- uses: dotnet/nbgv@master
id: nbgv
- name: Pack
run: dotnet pack -c Release -p:PackageVersion=${{ steps.nbgv.outputs.NuGetPackageVersion }}.${{ github.run_number }} -p:Version=${{ steps.nbgv.outputs.NuGetPackageVersion }}.${{ github.run_number }} -p:AssemblyVersion=${{ steps.nbgv.outputs.AssemblyVersion }} -p:AssemblyFileVersion=${{ steps.nbgv.outputs.AssemblyFileVersion }} -p:AssemblyInformationalVersion=${{ steps.nbgv.outputs.AssemblyInformationalVersion }} /p:NoPackageAnalysis=true
- name: Push
run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.MYGET_API_KEY }} --source https://www.myget.org/F/kerrylab/api/v3/index.json
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.4.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"buildNumber": {
"enabled": true,
"setVersionVariables": true
}
},
"nugetPackageVersion": {
"semVer": 2
}
}

0 comments on commit d7411c2

Please sign in to comment.