Skip to content

Release

Release #23

Workflow file for this run

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/[email protected]
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.SpecFlowPlugin/Schemas/allureConfig.schema.json
cat ./Allure.SpecFlowPlugin/Schemas/allureConfig.schema.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.NUnit/allureConfig.json
cat ./Allure.NUnit/allureConfig.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.SpecFlowPlugin/allureConfig.Template.json
cat ./Allure.SpecFlowPlugin/allureConfig.Template.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Features/allureConfig.json
cat ./Allure.Features/allureConfig.json
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.SpecFlowPlugin.Tests/allureConfig.json
cat ./Allure.SpecFlowPlugin.Tests/allureConfig.json
- 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 }}