-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61af93f
commit 32427ee
Showing
1 changed file
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,4 +286,72 @@ jobs: | |
name: systemtests-linux-trx-v${{ needs.build.outputs.product_full_version }} | ||
if-no-files-found: error | ||
path: "TestResults/*.trx" | ||
|
||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: [build, specs, system-tests-windows, system-tests-linux] | ||
environment: production_environment | ||
if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # avoid shallow clone git commit | ||
ref: ${{ github.head_ref }} | ||
ssh-key: ${{secrets.RELEASE_GIT_SSH_KEY}} | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: packages-v${{ needs.build.outputs.product_full_version }} | ||
path: release_packages | ||
- name: Display structure of downloaded files | ||
run: ls -R | ||
- name: Simulate Deployment | ||
env: | ||
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} | ||
shell: pwsh | ||
run: | | ||
Write-Output "Deploying (prod: ${{ needs.build.outputs.deploy_packages }}) ${{ needs.build.outputs.product_full_version }} (${{ needs.build.outputs.product_main_version }}) / key: $env:NUGET_PUBLISH_KEY" | ||
- name: Calculate Next Version | ||
if: needs.build.outputs.is_production_release == 'true' | ||
id: next_version | ||
shell: pwsh | ||
run: | | ||
$patchVersion = "${{ needs.build.outputs.product_patch_version }}" | ||
$nextPatch = [int]$patchVersion + 1 | ||
$nextVersion = "${{ needs.build.outputs.product_main_version }}.$nextPatch" | ||
Write-Output "product_next_version=$nextVersion" >> $env:GITHUB_OUTPUT | ||
Write-Output "Product Next Version: $nextVersion" | ||
- name: Bump Version | ||
if: needs.build.outputs.is_production_release == 'true' | ||
shell: pwsh | ||
run: | | ||
[System.IO.File]::WriteAllText("Directory.Build.props", [System.IO.File]::ReadAllText("Directory.Build.props").Replace("<VersionPrefix>${{ needs.build.outputs.product_version_prefix }}</VersionPrefix>", "<VersionPrefix>${{ steps.next_version.outputs.product_next_version }}</VersionPrefix>")) | ||
git status | ||
- name: Update Changelog | ||
if: needs.build.outputs.is_production_release == 'true' | ||
shell: pwsh | ||
run: | | ||
$newHeading = "# [vNext]$([Environment]::NewLine)$([Environment]::NewLine)## Improvements:$([Environment]::NewLine)$([Environment]::NewLine)## Bug fixes:$([Environment]::NewLine)$([Environment]::NewLine)*Contributors of this release (in alphabetical order):* $([Environment]::NewLine)$([Environment]::NewLine)" | ||
$releaseDate = [System.DateTime]::Today.ToString("yyyy-MM-dd") | ||
$newHeading = $newHeading + "# ${{ needs.build.outputs.product_full_version }} - $releaseDate" | ||
$content = [System.IO.File]::ReadAllText("CHANGELOG.md").Replace("# [vNext]",$newHeading) | ||
[System.IO.File]::WriteAllText("CHANGELOG.md", $content) | ||
- name: Update changes in GitHub repository | ||
if: needs.build.outputs.is_production_release == 'true' | ||
run: | | ||
git config --global user.name 'Reqnroll CI' | ||
git config --global user.email '[email protected]' | ||
git tag v${{ needs.build.outputs.product_full_version }} | ||
git push --dry-run origin tag v${{ needs.build.outputs.product_full_version }} | ||
git add -u | ||
git commit -m '[automated commit] bump version after release of ${{ needs.build.outputs.product_full_version }}' | ||
git push --dry-run | ||