diff --git a/.build/Common.ps1 b/.build/Common.ps1 deleted file mode 100644 index 0a3b13d8d..000000000 --- a/.build/Common.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -# Taken from psake https://github.com/psake/psake -<# -.SYNOPSIS - This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode - to see if an error occcured. If an error is detected then an exception is thrown. - This function allows you to run command-line programs without having to - explicitly check the $lastexitcode variable. -.EXAMPLE - Exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed" -#> -function Exec -{ - [CmdletBinding()] - param( - [Parameter(Position=0,Mandatory=1)][scriptblock]$cmd, - [Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd) - ) - & $cmd - if ($lastexitcode -ne 0) { - throw ("Exec: " + $errorMessage) - } -} - -$release = $env:APPVEYOR_REPO_TAG -eq "true" -and $env:APPVEYOR_REPO_TAG_NAME -$documentation = $release -or $env:APPVEYOR_REPO_BRANCH -eq "documentation-debug" \ No newline at end of file diff --git a/.build/Deploy-Documentation.ps1 b/.build/Deploy-Documentation.ps1 new file mode 100644 index 000000000..04e26eb1a --- /dev/null +++ b/.build/Deploy-Documentation.ps1 @@ -0,0 +1,14 @@ +$key = ("-----BEGIN RSA PRIVATE KEY-----`n" + + $env:DEPLOY_KEY.Replace(' ', "`n") + + "`n-----END RSA PRIVATE KEY-----`n") +Set-Content "$Home\.ssh\id_rsa" $key +git clone "git@github.com:ExtendedXmlSerializer/documentation.git" -b gh-pages .wwwroot -q + +Copy-Item .wwwroot/.git documentation/.wwwroot -recurse +CD documentation/.wwwroot +git config user.email $env:DEPLOY_EMAIL +git config user.name $env:DEPLOY_USER +git config core.safecrlf false +Exec { git add -A 2>&1 } +Exec { git commit -m "AppVeyor Continuous Deployment Documentation Update v$($env:APPVEYOR_BUILD_VERSION)" -q } +Exec { git push origin gh-pages -q } \ No newline at end of file diff --git a/.build/Install.ps1 b/.build/Install.ps1 index 671a58bcc..267ba0596 100644 --- a/.build/Install.ps1 +++ b/.build/Install.ps1 @@ -1,13 +1,25 @@ -if ($release) +# Taken from psake https://github.com/psake/psake +<# +.SYNOPSIS + This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode + to see if an error occcured. If an error is detected then an exception is thrown. + This function allows you to run command-line programs without having to + explicitly check the $lastexitcode variable. +.EXAMPLE + Exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed" +#> +function Exec { - Install-Module -Name PowerShellForGitHub + [CmdletBinding()] + param( + [Parameter(Position=0,Mandatory=1)][scriptblock]$cmd, + [Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd) + ) + & $cmd + if ($LastExitCode -ne 0) { + $host.SetShouldExit($LastExitCode) + throw ("Exec: " + $errorMessage) + } } -if($documentation) -{ - git checkout $env:APPVEYOR_REPO_BRANCH -q - choco install docfx -y -} - -git submodule -q update --init -git submodule update --rebase --remote \ No newline at end of file +git submodule update --init -q \ No newline at end of file diff --git a/.build/Prepare-Deployment.ps1 b/.build/Prepare-Deployment.ps1 new file mode 100644 index 000000000..907327e1e --- /dev/null +++ b/.build/Prepare-Deployment.ps1 @@ -0,0 +1,7 @@ +choco install docfx -y +Install-Module -Name PowerShellForGitHub + +$env:APPVEYOR_REPO_BRANCH = "master"; +git checkout $env:APPVEYOR_REPO_BRANCH -q + +git submodule update --rebase --remote \ No newline at end of file diff --git a/.build/Store-CurrentRelease.ps1 b/.build/Store-CurrentRelease.ps1 new file mode 100644 index 000000000..6139a09e9 --- /dev/null +++ b/.build/Store-CurrentRelease.ps1 @@ -0,0 +1,13 @@ +$parts = $env:APPVEYOR_REPO_NAME -Split '/' +$view = Get-GitHubRelease -OwnerName $parts[0] -RepositoryName $parts[1] -AccessToken $env:API_GITHUB_TOKEN | Where-Object {$_.tag_name -eq $env:APPVEYOR_REPO_TAG_NAME -and $_.assets.Length -eq 0} | Select-Object url, name, prerelease, body + +$enabled = !($view -eq $null) +Write-Host "Deploy GitHub Release: $enabled" + +if ($enabled) +{ + Set-AppveyorBuildVariable "DEPLOY_RELEASE_URL" $view.url + Set-AppveyorBuildVariable "DEPLOY_RELEASE_NAME" $view.name + Set-AppveyorBuildVariable "DEPLOY_RELEASE_IS_PRERELEASE" $view.prerelease + Set-AppveyorBuildVariable "DEPLOY_RELEASE_DESCRIPTION" $view.body +} \ No newline at end of file diff --git a/.build/Success.ps1 b/.build/Success.ps1 deleted file mode 100644 index f43524bbb..000000000 --- a/.build/Success.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -if($release) -{ - $headers = @{ - "Authorization" = "Bearer $env:API_APPVEYOR_TOKEN" - "Content-type" = "application/json" - "Accept" = "application/json" - } - $build = @{ - nextBuildNumber = 1 - } - $json = $build | ConvertTo-Json - Invoke-RestMethod -Method Put "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/settings/build-number" -Body $json -Headers $headers -} - -if($documentation) -{ - $key = ("-----BEGIN RSA PRIVATE KEY-----`n" + - $env:DEPLOY_KEY.Replace(' ', "`n") + - "`n-----END RSA PRIVATE KEY-----`n") - Set-Content "$Home\.ssh\id_rsa" $key - git clone "git@github.com:ExtendedXmlSerializer/documentation.git" -b gh-pages .wwwroot -q - Copy-Item .wwwroot/.git documentation/.wwwroot -recurse - CD documentation/.wwwroot - git config user.email $env:DEPLOY_EMAIL - git config user.name $env:DEPLOY_USER - git config core.safecrlf false - git add -A 2>&1 - git commit -m "AppVeyor Continuous Deployment Documentation Update v$($env:APPVEYOR_BUILD_VERSION)" -q - git push origin gh-pages -q -} - -if ($env:DEPLOY_RELEASE_URL) -{ - Write-Host "Deleting previous draft release: $env:DEPLOY_RELEASE_URL" - Invoke-RestMethod -Method DELETE -Headers @{ 'Authorization'="token $env:API_GITHUB_TOKEN" } -Uri $env:DEPLOY_RELEASE_URL -} diff --git a/.build/appveyor.yml b/.build/appveyor.yml index 9f7ccc073..ec03e77de 100644 --- a/.build/appveyor.yml +++ b/.build/appveyor.yml @@ -1,4 +1,3 @@ -version: '2.1.25.{build}' environment: BUILD_SOLUTION_PATH: '.\ExtendedXmlSerializer.sln' BUILD_DOCUMENTATION_PATH: '.\documentation\docfx.json' @@ -8,95 +7,117 @@ environment: secure: xQR4THytwto+UTuQtpj5N5RcD4pDHIJVnahrbQ7Xqjs= DEPLOY_KEY: secure: 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 - DEPLOY_USER: Extended Xml Serializer AppVeyor Automation + DEPLOY_USER: ExtendedXmlSerializer Automation via AppVeyor DEPLOY_EMAIL: ExtendedXmlSerializer@users.noreply.github.com image: Visual Studio 2019 -branches: - only: - - master - - debug/documentation - - debug/deployment -notifications: - - provider: GitHubPullRequest - template: | - {{#passed}}:white_check_mark:{{/passed}}{{#failed}}:x:{{/failed}} [Build {{&projectName}} {{buildVersion}} {{status}}]({{buildUrl}}) (commit {{commitUrl}} by @{{&commitAuthorUsername}}) +skip_tags: true +skip_non_tags: true +skip_commits: + author: /Automation Agent/ + +only_commits: + files: + - '*.sln' + - '.build\**\*' + - src\**\* + - test\**\* + - documentation\**\* - {{#passed}} - Install it by running the following command in [Package Manager Console](https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-powershell): - - ``` - Install-Package ExtendedXmlSerializer -Version {{buildVersion}} -Source https://ci.appveyor.com/nuget/extendedxmlserializer-preview - ``` - {{/passed}} - on_build_success: true -pull_requests: - do_not_increment_build_number: true - -install: - - ps: . .\.build\Common.ps1 - - ps: .\.build\Install.ps1 +configuration: Debug dotnet_csproj: patch: true file: src\*\*.csproj version_prefix: '{version}' -build_script: +nuget: + project_feed: false + disable_publish_on_pr: true + +pull_requests: + do_not_increment_build_number: true + +for: +- # Development + skip_non_tags: false + branches: + only: + - master + + install: + - ps: . .\.build\Install.ps1 + + build_script: - ps: | Exec { & dotnet build $env:BUILD_SOLUTION_PATH -c Release } Exec { & dotnet pack $env:BUILD_SOLUTION_PATH -c Release } + + notifications: + - provider: GitHubPullRequest + template: | + {{#passed}}:white_check_mark:{{/passed}}{{#failed}}:x:{{/failed}} [Build {{&projectName}} {{buildVersion}} {{status}}]({{buildUrl}}) (commit {{commitUrl}} by @{{&commitAuthorUsername}}) + + {{#passed}} + Install it by running the following command in [Package Manager Console](https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-powershell): + + ``` + Install-Package ExtendedXmlSerializer -Version {{buildVersion}} -Source https://ci.appveyor.com/nuget/extendedxmlserializer-preview + ``` + {{/passed}} + on_build_success: true - if ($documentation) - { - Exec { & docfx $env:BUILD_DOCUMENTATION_PATH } - } + after_test: + - ps: Exec { & dotnet test $env:BUILD_SOLUTION_PATH -c Release -f netcoreapp2.1 } -after_test: - - ps: Exec { & dotnet test $env:BUILD_SOLUTION_PATH -c Release -f netcoreapp2.1 } + nuget: + project_feed: true + disable_publish_on_pr: false + + artifacts: + - path: src\**\*.nupkg + name: 'Preview Package $(APPVEYOR_BUILD_VERSION)' -nuget: - project_feed: true - disable_publish_on_pr: false -artifacts: -- path: src\**\*.nupkg - name: 'Preview Package $(APPVEYOR_BUILD_VERSION)' +- # Deploy + skip_tags: false + branches: + only: + - /\d*\.\d*\.\d*/ + + cache: + - '%USERPROFILE%\.ssh\known_hosts' -before_deploy: - - ps: | - if ($release) - { - $view = Get-GitHubRelease -OwnerName ExtendedXmlSerializer -RepositoryName ExtendedXmlSerializer -AccessToken $env:API_GITHUB_TOKEN | Where-Object {$_.tag_name.StartsWith("untagged-")} | Sort-Object created_at -Descending | Select-Object url, body -First 1 - if ($view) - { - Set-AppveyorBuildVariable "DEPLOY_RELEASE_DESCRIPTION" $view.body - Set-AppveyorBuildVariable "DEPLOY_RELEASE_URL" $view.url - } - - $name = @{ $true = $env:appveyor_build_version; $false = $env:APPVEYOR_REPO_TAG_NAME }[-Not $env:APPVEYOR_REPO_TAG_NAME] - Write-Host "Assigning Build Tag Name: $name" - Set-AppveyorBuildVariable "DEPLOY_TAG_NAME" $name - } -deploy: -- provider: NuGet - name: production - api_key: - secure: kExW39+W8VRwk3UMReJiT7h2ySKqC9ZpbSPJ87zFNn8uTSLMsZNMCVn/VMrY+7Q7 - on: - branch: master - appveyor_repo_tag: true -- provider: GitHub - tag: v$(DEPLOY_TAG_NAME) - release: ExtendedXmlSerializer v$(appveyor_build_version) - description: $(DEPLOY_RELEASE_DESCRIPTION) - artifact: /.*\.nupkg/ - draft: false - prerelease: false - auth_token: $(API_GITHUB_TOKEN) - on: - branch: master - appveyor_repo_tag: true - -on_success: - - ps: .\.build\Success.ps1 \ No newline at end of file + install: + - ps: . .\.build\Install.ps1 + - ps: .\.build\Prepare-Deployment.ps1 + + build_script: + - ps: Exec { & dotnet pack $env:BUILD_SOLUTION_PATH -c Release } + - ps: Exec { & docfx $env:BUILD_DOCUMENTATION_PATH } + + test: off + + before_deploy: + - ps: .\.build\Store-CurrentRelease.ps1 + + artifacts: + - path: src\**\*.nupkg + name: '$(APPVEYOR_PROJECT_NAME) $(APPVEYOR_BUILD_VERSION)' + + deploy: + - provider: GitHub + tag: $(APPVEYOR_REPO_TAG_NAME) + release: $(DEPLOY_RELEASE_NAME) + description: $(DEPLOY_RELEASE_DESCRIPTION) + artifact: /.*\.nupkg/ + draft: false + prerelease: $(DEPLOY_RELEASE_IS_PRERELEASE) + auth_token: $(API_GITHUB_TOKEN) + force_update: true + # - provider: NuGet + # name: production + # api_key: + # secure: kExW39+W8VRwk3UMReJiT7h2ySKqC9ZpbSPJ87zFNn8uTSLMsZNMCVn/VMrY+7Q7 + on_success: + - ps: .\.build\Deploy-Documentation.ps1 diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 6a571aed7..000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,23 +0,0 @@ -name-template: 'ExtendedXmlSerializer v$NEXT_PATCH_VERSION ⚙' -tag-template: 'v$NEXT_PATCH_VERSION' -categories: - - title: '😱 Breaking Changes 💥' - labels: - - breaking change - - title: '🚀 Features' - labels: - - enhancement - - title: '🐰 Performance' - labels: - - performance - - title: '🐛 Bug Fixes' - labels: - - bug - - title: '🧰 Maintenance' - label: - - housekeeping - - refactoring -template: | - ## What's New - - $CHANGES \ No newline at end of file diff --git a/.github/workflows/publish-release-build.yml b/.github/workflows/publish-release-build.yml new file mode 100644 index 000000000..8b2d813fa --- /dev/null +++ b/.github/workflows/publish-release-build.yml @@ -0,0 +1,118 @@ +name: Publish Release Build + +on: + release: + types: [published] + +env: + DEPLOY_USER: "ExtendedXmlSerializer's GitHub Action Automation Agent" + DEPLOY_EMAIL: "ExtendedXmlSerializer@users.noreply.github.com" + DEPLOY_COMMIT_MESSAGE: Adding CHANGELOG.md + DEPLOY_ACCOUNT: ExtendedXmlSerializer + DEPLOY_SLUG: extendedxmlserializer + DEPLOY_BRANCH: master + +jobs: + generate_and_save: + runs-on: ubuntu-latest + steps: + - id: generate + name: Generate CHANGELOG + uses: dragonspark/action-changelog-dawg@master + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload CHANGELOG + uses: actions/upload-artifact@v1 + with: + name: store + path: '${{ steps.generate.outputs.filename }}' + + load_and_push: + runs-on: ubuntu-latest + needs: [generate_and_save] + steps: + - uses: actions/checkout@master + with: + ref: refs/heads/master + - name: Download the CHANGELOG + uses: actions/download-artifact@v1 + with: + name: store + path: ./ + - name: Add and Commit + run: | + git config user.email $env:DEPLOY_EMAIL + git config user.name $env:DEPLOY_USER + git add -A 2>&1 + git commit -m $env:DEPLOY_COMMIT_MESSAGE + shell: pwsh + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + load_and_push_to_wiki: + runs-on: ubuntu-latest + needs: [generate_and_save] + steps: + - uses: actions/checkout@master + with: + repository: ${{ github.repository }}.wiki + ref: refs/heads/master + path: ./${{ github.event.repository.name }} + - name: Download the CHANGELOG + uses: actions/download-artifact@v1 + with: + name: store + path: ./ + - name: Add and Commit + run: | + git config user.email $env:DEPLOY_EMAIL + git config user.name $env:DEPLOY_USER + git add -A 2>&1 + git commit -m $env:DEPLOY_COMMIT_MESSAGE + shell: pwsh + - name: Push changes + uses: ad-m/github-push-action@master + with: + repository: ${{ github.repository }}.wiki + github_token: ${{ secrets.GITHUB_TOKEN }} + + build: + needs: [load_and_push, load_and_push_to_wiki] + + runs-on: ubuntu-latest + + steps: + - name: Apply and Update Build Versioning + run: | + $current = [System.Management.Automation.SemanticVersion]"${{ github.event.release.tag_name }}".TrimStart("vV") + + $token = ConvertTo-SecureString "${{ secrets.API_APPVEYOR_TOKEN }}" -AsPlainText -Force + $s = Invoke-RestMethod "https://ci.appveyor.com/api/projects/$env:DEPLOY_ACCOUNT/$env:DEPLOY_SLUG/settings" -Authentication Bearer -Token $token + $s.settings.versionFormat = "$current.{build}" + $s.settings.nextBuildNumber = "0" + Invoke-RestMethod 'https://ci.appveyor.com/api/projects' -Method Put -Authentication Bearer -Token $token -Body ($s.settings | ConvertTo-Json -Depth 10) -ContentType "application/json" + shell: pwsh + - name: Initiate Build Process + run: | + $headers = @{ + "Authorization" = "Bearer ${{ secrets.API_APPVEYOR_TOKEN }}" + "Content-type" = "application/json" + } + + $body = @{ + accountName = $env:DEPLOY_ACCOUNT + projectSlug = $env:DEPLOY_SLUG + branch = "${{ github.event.release.tag_name }}" + commitId = "${{ github.event.release.tag_name }}" + environmentVariables = @{ + APPVEYOR_REPO_COMMIT_AUTHOR = $env:DEPLOY_USER + APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL = $env:DEPLOY_EMAIL + APPVEYOR_REPO_TAG = $true + APPVEYOR_REPO_TAG_NAME = "${{ github.event.release.tag_name }}" + } + } | ConvertTo-Json + + Invoke-RestMethod 'https://ci.appveyor.com/api/builds' -Method POST -Headers $headers -Body $body + shell: pwsh diff --git a/.github/workflows/update-changelog-dawg.yml b/.github/workflows/update-changelog-dawg.yml new file mode 100644 index 000000000..ff79e5fee --- /dev/null +++ b/.github/workflows/update-changelog-dawg.yml @@ -0,0 +1,76 @@ +name: Update the CHANGELOG + +on: + release: + types: [unpublished, edited, deleted] + +env: + DEPLOY_USER: "ExtendedXmlSerializer's GitHub Action Automation Agent" + DEPLOY_EMAIL: "ExtendedXmlSerializer@users.noreply.github.com" + DEPLOY_COMMIT_MESSAGE: Adding CHANGELOG.md + +jobs: + generate_and_save: + runs-on: ubuntu-latest + steps: + - id: generate + name: Generate CHANGELOG + uses: dragonspark/action-changelog-dawg@master + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload CHANGELOG + uses: actions/upload-artifact@v1 + with: + name: store + path: '${{ steps.generate.outputs.filename }}' + + load_and_push: + runs-on: ubuntu-latest + needs: [generate_and_save] + steps: + - uses: actions/checkout@master + with: + ref: refs/heads/master + - name: Download the CHANGELOG + uses: actions/download-artifact@v1 + with: + name: store + path: ./ + - name: Add and Commit + run: | + git config user.email $env:DEPLOY_EMAIL + git config user.name $env:DEPLOY_USER + git add -A 2>&1 + git commit -m $env:DEPLOY_COMMIT_MESSAGE + shell: pwsh + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + load_and_push_to_wiki: + runs-on: ubuntu-latest + needs: [generate_and_save] + steps: + - uses: actions/checkout@master + with: + repository: ${{ github.repository }}.wiki + ref: refs/heads/master + path: ./${{ github.event.repository.name }} + - name: Download the CHANGELOG + uses: actions/download-artifact@v1 + with: + name: store + path: ./ + - name: Add and Commit + run: | + git config user.email $env:DEPLOY_EMAIL + git config user.name $env:DEPLOY_USER + git add -A 2>&1 + git commit -m $env:DEPLOY_COMMIT_MESSAGE + shell: pwsh + - name: Push changes + uses: ad-m/github-push-action@master + with: + repository: ${{ github.repository }}.wiki + github_token: ${{ secrets.GITHUB_TOKEN }}