diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..fa06097 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: CI + +on: [create] + +jobs: + build: + name: Build Project + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.101' + - name: Build + run: dotnet build MonkeyDotNet/Monkey + + publish: + needs: build + name: Publish Project to Nuget + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.101' + - name: Publish + run: | + version=`git describe --tags` + dotnet pack --configuration release -p:PackageVersion=$version + dotnet nuget push bin/release/Monkey.$version.nupkg -k ${APIKEY} -s https://www.nuget.org/api/v2/package + env: + APIKEY: ${{ secrets.APPKEY }} diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml deleted file mode 100644 index f48ee91..0000000 --- a/.github/workflows/publish-nuget.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: PublishToNuget - -on: [push] - -jobs: - build: - name: publish to nuget - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - name: Publish NuGet - uses: rohith/publish-nuget@v1.0.3 - with: - nuget_key: ${{ secrets.NugetKey }}