diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..76b5d1b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,43 @@ +name: .NET Core CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.101 + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore + + - name: Test + run: dotnet test --no-build --verbosity normal + + package: + needs: build + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.101 + + - name: Pack + run: dotnet pack -c Release /p:PackageVersion=${GITHUB_REF#refs/tags/v} + + - name: Push + run: dotnet nuget push AStar/bin/Release/AStarLite.${GITHUB_REF#refs/tags/v}.nupkg -s https://www.nuget.org/api/v2/package -k ${{ secrets.NUGET_API_KEY }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ff0c10e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: csharp -mono: none -dist: focal -dotnet: 6.0.101 -os: linux - -stages: - - build and test - - package - -jobs: - include: - - stage: build and test - script: - - dotnet restore - - dotnet build - - dotnet test AStar.Tests/AStar.Tests.csproj - - stage: package - if: tag =~ ^v - script: - - dotnet pack -c Release /p:PackageVersion=${TRAVIS_TAG:1} - - dotnet nuget push AStar/bin/Release/AStarLite.${TRAVIS_TAG:1}.nupkg -s https://www.nuget.org/api/v2/package -k $NUGET_API_KEY \ No newline at end of file