diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..510aec0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: Build CodeGenHelpers + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + name: Build CodeGenHelpers + runs-on: windows-latest + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup .NET Core 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' + include-prerelease: true + + - name: NuGet Restore + run: dotnet restore + + - name: Build Packages + run: dotnet build .\CodeGenHelpers.sln -c Release + + - name: Test + run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build -c Release + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: NuGet + path: Artifacts/ + + - name: NuGet Publish (In-House) + if: ${{ github.event_name != 'pull_request' }} + uses: dansiegel/publish-nuget@v1.01 + with: + filename: 'Artifacts/*.nupkg' + feedUrl: ${{ secrets.IN_HOUSE_NUGET_FEED }} + apiKey: ${{ secrets.IN_HOUSE_API_KEY }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 6618e42..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,59 +0,0 @@ -trigger: -- master - -name: $(Build.BuildId) - -variables: -- name: BuildConfiguration - value: Release - -stages: -- stage: build - displayName: Build - jobs: - - job: buildAndTest - displayName: 'Build & Test' - pool: - vmImage: windows-latest - steps: - - task: UseDotNet@2 - inputs: - useGlobalJson: true - - - task: NuGetToolInstaller@1 - inputs: - checkLatest: true - - - task: NuGetCommand@2 - displayName: NuGet Restore - inputs: - command: restore - - - task: MSBuild@1 - displayName: Build & Pack - inputs: - configuration: $(BuildConfiguration) - - - task: DotNetCoreCLI@2 - displayName: Run Unit Tests - inputs: - command: 'test' - nobuild: true - projects: '**/*.csproj' - testRunTitle: 'Code Gen Helpers' - workingDirectory: 'tests' - - - task: PublishPipelineArtifact@1 - inputs: - targetPath: '$(Build.ArtifactStagingDirectory)' - artifact: 'nuget' - publishLocation: 'pipeline' - - - task: NuGetCommand@2 - displayName: NuGet Push - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - inputs: - command: 'push' - packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' - nuGetFeedType: 'external' - publishFeedCredentials: 'SponsorConnect'