Release #25
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
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: "The release version in <MAJOR>.<MINOR>.<PATCH> format" | |
required: true | |
nextVersion: | |
description: "The next version in <MAJOR>.<MINOR> format WITHOUT SNAPSHOT SUFFIX" | |
required: true | |
prerelease: | |
description: "Preview release" | |
required: true | |
type: boolean | |
default: false | |
previewVersion: | |
description: "Preview version number, integer" | |
required: false | |
default: "1" | |
jobs: | |
triage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check release version" | |
run: | | |
expr "${{ inputs.releaseVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$' | |
echo "release_version=${{ inputs.releaseVersion }}" >> $GITHUB_ENV | |
- name: "Check next version" | |
run: | | |
expr "${{ inputs.nextVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$' | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.QAMETA_CI }} | |
- name: "Mark release as preview" | |
if: ${{ inputs.prerelease }} | |
run: | | |
echo "release_version=${{ inputs.releaseVersion }}-preview.${{ inputs.previewVersion }}" >> $GITHUB_ENV | |
- name: "Configure CI Git User" | |
run: | | |
git config --global user.name qameta-ci | |
git config --global user.email [email protected] | |
- name: "Set release version" | |
run: | | |
sed -i -e '/<PropertyGroup>/,/<\/PropertyGroup>/ s|<Version>[0-9a-zA-Z.|-]*</Version>|<Version>${{ env.release_version }}</Version>|g' ./Directory.Build.props | |
cat ./Directory.Build.props | |
- name: "Update schema links" | |
run: | | |
sed -i -e '/"$ref"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.NUnit/Schemas/allureConfig.schema.json | |
cat ./Allure.NUnit/Schemas/allureConfig.schema.json | |
sed -i -e '/"$ref"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Xunit/Schemas/allureConfig.schema.json | |
cat ./Allure.Xunit/Schemas/allureConfig.schema.json | |
sed -i -e '/"$ref"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlow/Schemas/allureConfig.schema.json | |
cat ./Allure.SpecFlow/Schemas/allureConfig.schema.json | |
sed -i -e '/"$ref"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Reqnroll/Schemas/allureConfig.schema.json | |
cat ./Allure.Reqnroll/Schemas/allureConfig.schema.json | |
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Net.Commons/allureConfig.Template.json | |
cat ./Allure.Net.Commons/allureConfig.Template.json | |
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.NUnit.Examples/allureConfig.json | |
cat ./Allure.NUnit.Examples/allureConfig.json | |
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Xunit.Examples/allureConfig.json | |
cat ./Allure.Xunit.Examples/allureConfig.json | |
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlow/allureConfig.Template.json | |
cat ./Allure.SpecFlow/allureConfig.Template.json | |
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlow.Tests.Samples/allureConfig.json | |
cat ./Allure.SpecFlow.Tests.Samples/allureConfig.json | |
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlow.Tests/allureConfig.json | |
cat ./Allure.SpecFlow.Tests/allureConfig.json | |
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Reqnroll/allureConfig.Template.json | |
cat ./Allure.Reqnroll/allureConfig.Template.json | |
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Reqnroll.Tests.Samples/allureConfig.json | |
cat ./Allure.Reqnroll.Tests.Samples/allureConfig.json | |
- name: "Update release notes link" | |
run: | | |
sed -i -e '/<PackageReleaseNotes>/,/<\/PackageReleaseNotes>/ s|/tag/[0-9a-zA-Z.|-]*|/tag/${{ inputs.release_version }}|g' ./Directory.Build.props | |
cat ./Directory.Build.props | |
- name: "Commit release version and create tag" | |
run: | | |
git commit -am "release ${{ env.release_version }}" | |
git tag ${{ env.release_version }} | |
git push origin ${{ env.release_version }} | |
- name: "Set next development version" | |
run: | | |
sed -i -e '/<PropertyGroup>/,/<\/PropertyGroup>/ s|<Version>[0-9a-zA-Z.|-]*</Version>|<Version>${{ inputs.nextVersion }}-SNAPSHOT</Version>|g' ./Directory.Build.props | |
cat ./Directory.Build.props | |
- name: "Commit next development version and push it" | |
run: | | |
git commit -am "set next development version ${{ inputs.nextVersion }}" | |
git push origin ${{ github.ref }} | |
- name: "Publish Github Release" | |
uses: octokit/[email protected] | |
with: | |
route: POST /repos/${{ github.repository }}/releases | |
tag_name: ${{ env.release_version }} | |
generate_release_notes: true | |
target_commitish: ${{ github.ref }} | |
prerelease: ${{ inputs.prerelease }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.QAMETA_CI }} |