mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-12-22 10:31:46 +03:00
Add hotfixing workflow
This commit is contained in:
parent
fb96c252cf
commit
fc6e6b57b9
6
.github/workflows/accept-pull-request.yml
vendored
6
.github/workflows/accept-pull-request.yml
vendored
@ -128,10 +128,9 @@ jobs:
|
||||
comment="✅ Github release ${tag_version} is published."
|
||||
echo " - ${comment}"
|
||||
else
|
||||
comment="❌ Github release ${tag_version} is still in draft/prerelease. Please publish it before trying to merge this release PR."
|
||||
comment="⚠ Github release ${tag_version} is still in draft/prerelease. Please don't forget to publish it after merging this release PR."
|
||||
echo " - ${comment}"
|
||||
gh pr comment "${PR_NUMBER}" --body "${comment}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -247,7 +246,7 @@ jobs:
|
||||
- accept-pull-request
|
||||
name: update-branch-version
|
||||
if: needs.accept-pull-request.outputs.is_a_github_release_pr == 'true' && contains(github.event.comment.body, '--release')
|
||||
uses: Orange-OpenSource/hurl/.github/workflows/update-branch-version.yml@master
|
||||
uses: ./.github/workflows/update-branch-version.yml
|
||||
with:
|
||||
new_version: ${{ needs.accept-pull-request.outputs.new_version_master_snapshot_version }}
|
||||
branch: ${{ needs.accept-pull-request.outputs.base_ref }}
|
||||
@ -272,3 +271,4 @@ jobs:
|
||||
- name: release-final-comment
|
||||
run: |
|
||||
gh pr comment "${{ github.event.issue.number }}" --body "✅ New PR [${{ needs.update-branch-version.outputs.pr_number }}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/pull/${{ needs.update-branch-version.outputs.pr_number }}) created to update master branch to ${{ needs.accept-pull-request.outputs.new_version_master_snapshot_version }} version"
|
||||
|
||||
|
159
.github/workflows/release.yml
vendored
159
.github/workflows/release.yml
vendored
@ -3,8 +3,8 @@ name: release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
control-release-version:
|
||||
description: 'Control release version'
|
||||
set-release-version:
|
||||
description: 'Set release version (x.y.z)'
|
||||
required: true
|
||||
type: string
|
||||
create-release-branch:
|
||||
@ -21,7 +21,7 @@ on:
|
||||
concurrency: release
|
||||
|
||||
jobs:
|
||||
control-release:
|
||||
set-context:
|
||||
if: github.event.inputs.create-release-branch == 'true'
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
@ -29,48 +29,44 @@ jobs:
|
||||
outputs:
|
||||
release_version: ${{ steps.set-release-version.outputs.release_version }}
|
||||
release_branch: ${{ steps.set-release-branch.outputs.release_branch }}
|
||||
name: control-release
|
||||
name: set-context
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Check trigger branch
|
||||
run: |
|
||||
if [ "${{ github.ref_name }}" == "master" ] ; then
|
||||
echo " - ✅ The branch triggering this workflow is master."
|
||||
if [ $(echo "${{ github.ref_name }}" | grep -Ec "^master$|^release/") -eq 1 ] ; then
|
||||
echo " - ✅ The branch triggering this workflow is ${{ github.ref_name }}."
|
||||
else
|
||||
echo " - ❌ The branch triggering this workflow is ${{ github.ref_name }} instead of master."
|
||||
echo " - ❌ The branch triggering this workflow is ${{ github.ref_name }} instead of master or release/[0-9].[0-9].[0-9] ."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Set release version
|
||||
id: set-release-version
|
||||
run: |
|
||||
actual_version=$(grep -E "^version" packages/hurl/Cargo.toml | cut --delimiter "=" --field 2 | tr -d '" ')
|
||||
echo "actual_version=${actual_version}" | tee -a $GITHUB_OUTPUT
|
||||
release_version=$(echo "${actual_version}" | cut --delimiter "-" --field 1)
|
||||
echo "release_version=${release_version}" | tee -a $GITHUB_OUTPUT
|
||||
echo "release_version=${{ github.event.inputs.set-release-version }}" | tee -a $GITHUB_OUTPUT
|
||||
|
||||
- name: Set release branch
|
||||
id: set-release-branch
|
||||
run: |
|
||||
echo "release_branch=release/${{ steps.set-release-version.outputs.release_version }}" | tee -a $GITHUB_OUTPUT
|
||||
if [ $(echo "${{ github.ref_name }}" | grep -c "^release/") -eq 1 ] ; then
|
||||
echo "release_branch=${{ github.ref_name }}" | tee -a $GITHUB_OUTPUT
|
||||
else
|
||||
echo "release_branch=release/${{ github.event.inputs.set-release-version }}" | tee -a $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Control release version
|
||||
run: |
|
||||
if [ "${{ github.event.inputs.control-release-version }}" == "${{ steps.set-release-version.outputs.release_version }}" ] ; then
|
||||
echo " - ✅ Desired release version ${{ github.event.inputs.control-release-version }} equals version ${{ steps.set-release-version.outputs.release_version }} getted from package/hurl/Cargo.toml on master."
|
||||
if [ "${{ github.event.inputs.set-release-version }}" == "${{ steps.set-release-version.outputs.release_version }}" ] ; then
|
||||
echo " - ✅ Desired release version ${{ github.event.inputs.set-release-version }} equals version ${{ steps.set-release-version.outputs.release_version }} getted from package/hurl/Cargo.toml on ${{ github.ref_name }}."
|
||||
else
|
||||
echo " - ❌ Desired release version ${{ github.event.inputs.control-release-version }} do not equals version ${{ steps.set-release-version.outputs.release_version }} getted from package/hurl/Cargo.toml on master."
|
||||
echo " - ❌ Desired release version ${{ github.event.inputs.set-release-version }} do not equals version ${{ steps.set-release-version.outputs.release_version }} getted from package/hurl/Cargo.toml on ${{ github.ref_name }}."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
clean-release:
|
||||
if: github.event.inputs.create-release-branch == 'true'
|
||||
needs: control-release
|
||||
needs: set-context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@ -79,13 +75,11 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Check release pull request existence
|
||||
id: check-release-pull-request-existence
|
||||
run: |
|
||||
actual_pr_number=$(gh pr list --repo "${{ github.repository }}" --head "${{ needs.control-release.outputs.release_branch }}" --state "open" --json number --jq .[].number)
|
||||
actual_pr_number=$(gh pr list --repo "${{ github.repository }}" --head "${{ needs.set-context.outputs.release_branch }}" --state "open" --json number --jq .[].number)
|
||||
actual_pr_number=${actual_pr_number:-0}
|
||||
echo "actual_pr_number=${actual_pr_number}" | tee -a "${GITHUB_OUTPUT}"
|
||||
if [ ${actual_pr_number} -eq 0 ] ; then
|
||||
@ -114,72 +108,73 @@ jobs:
|
||||
id: check-github-release-existence
|
||||
run: |
|
||||
gh release list || true
|
||||
escaped_version=$(echo "${{ needs.control-release.outputs.release_version }}" | sed "s#\.#\\\.#g")
|
||||
escaped_version=$(echo "${{ needs.set-context.outputs.release_version }}" | sed "s#\.#\\\.#g")
|
||||
github_release_exists=$(gh release list | (grep -c "${escaped_version}" || true))
|
||||
if [ ${github_release_exists} -eq 0 ] ; then
|
||||
echo " - ✅ Github release ${{ needs.control-release.outputs.release_version }} does not exist."
|
||||
echo " - ✅ Github release ${{ needs.set-context.outputs.release_version }} does not exist."
|
||||
echo "github_release_exists=false" | tee -a $GITHUB_OUTPUT
|
||||
else
|
||||
echo " - ✅ Github release ${{ needs.control-release.outputs.release_version }} already exists on remote."
|
||||
echo " - ✅ Github release ${{ needs.set-context.outputs.release_version }} already exists on remote."
|
||||
echo "github_release_exists=true" | tee -a $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Delete github release
|
||||
if: steps.check-github-release-existence.outputs.github_release_exists == 'true'
|
||||
run: |
|
||||
gh release delete ${{ needs.control-release.outputs.release_version }} --yes && gh_exit_code=0 || gh_exit_code=$?
|
||||
gh release delete ${{ needs.set-context.outputs.release_version }} --yes && gh_exit_code=0 || gh_exit_code=$?
|
||||
if [ ${gh_exit_code} -eq 0 ] ; then
|
||||
echo " - ✅ ${{ needs.control-release.outputs.release_version }} github release deleted."
|
||||
echo " - ✅ ${{ needs.set-context.outputs.release_version }} github release deleted."
|
||||
else
|
||||
echo " - ❌ A problem occurs when attempting to delete ${{ needs.control-release.outputs.release_version }} github release."
|
||||
echo " - ❌ A problem occurs when attempting to delete ${{ needs.set-context.outputs.release_version }} github release."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check tag existence
|
||||
id: check-tag-existence
|
||||
run: |
|
||||
escaped_version=$(echo "${{ needs.control-release.outputs.release_version }}" | sed "s#\.#\\\.#g")
|
||||
escaped_version=$(echo "${{ needs.set-context.outputs.release_version }}" | sed "s#\.#\\\.#g")
|
||||
tag_exists=$(git ls-remote --tags | (grep -c "${escaped_version}" || true))
|
||||
if [ ${tag_exists} -eq 0 ] ; then
|
||||
echo " - ✅ The origin/${{ needs.control-release.outputs.release_version }} tag does not exists on remote."
|
||||
echo " - ✅ The origin/${{ needs.set-context.outputs.release_version }} tag does not exists on remote."
|
||||
echo "release_tag_exists=false" | tee -a $GITHUB_OUTPUT
|
||||
else
|
||||
echo " - ✅ The origin/${{ needs.control-release.outputs.release_version }} tag already exists on remote."
|
||||
echo " - ✅ The origin/${{ needs.set-context.outputs.release_version }} tag already exists on remote."
|
||||
echo "release_tag_exists=true" | tee -a $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Delete release tag
|
||||
if: steps.check-tag-existence.outputs.release_tag_exists == 'true'
|
||||
run: |
|
||||
git push origin --delete ${{ needs.control-release.outputs.release_version }} && git_exit_code=0 || git_exit_code=$?
|
||||
git push origin --delete ${{ needs.set-context.outputs.release_version }} && git_exit_code=0 || git_exit_code=$?
|
||||
if [ ${git_exit_code} -eq 0 ] ; then
|
||||
echo " - ✅ ${{ needs.control-release.outputs.release_version }} tag deleted."
|
||||
echo " - ✅ ${{ needs.set-context.outputs.release_version }} tag deleted."
|
||||
else
|
||||
echo " - ❌ A problem occurs when attempting to delete ${{ needs.control-release.outputs.release_version }} tag."
|
||||
echo " - ❌ A problem occurs when attempting to delete ${{ needs.set-context.outputs.release_version }} tag."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check branch existence
|
||||
id: check-branch-existence
|
||||
- name: Check release branch existence
|
||||
id: check-release-branch-existence
|
||||
if: github.ref_name == 'master'
|
||||
run: |
|
||||
escaped_version=$(echo "${{ needs.control-release.outputs.release_version }}" | sed "s#\.#\\\.#g")
|
||||
escaped_version=$(echo "${{ needs.set-context.outputs.release_version }}" | sed "s#\.#\\\.#g")
|
||||
branch_exists=$(git ls-remote | (grep -c "${escaped_version}" || true))
|
||||
if [ ${branch_exists} -eq 0 ] ; then
|
||||
echo " - ✅ The origin/${{ needs.control-release.outputs.release_branch }} branch does not exists on remote."
|
||||
echo " - ✅ The origin/${{ needs.set-context.outputs.release_branch }} branch does not exists on remote."
|
||||
echo "release_branch_exists=false" | tee -a $GITHUB_OUTPUT
|
||||
else
|
||||
echo " - ✅ The origin/${{ needs.control-release.outputs.release_branch }} branch already exists on remote."
|
||||
echo " - ✅ The origin/${{ needs.set-context.outputs.release_branch }} branch already exists on remote."
|
||||
echo "release_branch_exists=true" | tee -a $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Delete release branch
|
||||
if: steps.check-branch-existence.outputs.release_branch_exists == 'true'
|
||||
if: github.ref_name == 'master' && steps.check-release-branch-existence.outputs.release_branch_exists == 'true'
|
||||
run: |
|
||||
git push origin --delete ${{ needs.control-release.outputs.release_branch }} && git_exit_code=0 || git_exit_code=$?
|
||||
git push origin --delete ${{ needs.set-context.outputs.release_branch }} && git_exit_code=0 || git_exit_code=$?
|
||||
if [ ${git_exit_code} -eq 0 ] ; then
|
||||
echo " - ✅ ${{ needs.control-release.outputs.release_branch }} branch deleted."
|
||||
echo " - ✅ ${{ needs.set-context.outputs.release_branch }} branch deleted."
|
||||
else
|
||||
echo " - ❌ A problem occurs when attempting to delete ${{ needs.control-release.outputs.release_branch }} branch."
|
||||
echo " - ❌ A problem occurs when attempting to delete ${{ needs.set-context.outputs.release_branch }} branch."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -187,7 +182,7 @@ jobs:
|
||||
if: github.event.inputs.create-release-branch == 'true'
|
||||
needs:
|
||||
- clean-release
|
||||
- control-release
|
||||
- set-context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@ -196,25 +191,24 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Create release branch
|
||||
if: github.ref_name == 'master'
|
||||
id: create-release-branch
|
||||
run: |
|
||||
git checkout -b "${{ needs.control-release.outputs.release_branch }}"
|
||||
git push origin "${{ needs.control-release.outputs.release_branch }}" && git_exit_code=0 || git_exit_code=$?
|
||||
git checkout -b "${{ needs.set-context.outputs.release_branch }}"
|
||||
git push origin "${{ needs.set-context.outputs.release_branch }}" && git_exit_code=0 || git_exit_code=$?
|
||||
if [ ${git_exit_code} -eq 0 ] ; then
|
||||
echo " - ✅ ${{ needs.control-release.outputs.release_branch }} branch created."
|
||||
echo " - ✅ ${{ needs.set-context.outputs.release_branch }} branch created."
|
||||
else
|
||||
echo " - ❌ A problem occurs when attempting to create ${{ needs.control-release.outputs.release_branch }} branch."
|
||||
echo " - ❌ A problem occurs when attempting to create ${{ needs.set-context.outputs.release_branch }} branch."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Checkout new release branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ needs.control-release.outputs.release_branch }}
|
||||
ref: ${{ needs.set-context.outputs.release_branch }}
|
||||
|
||||
- name: Init git credentials
|
||||
run: |
|
||||
@ -226,13 +220,13 @@ jobs:
|
||||
hurl_packages="hurl_core hurl hurlfmt"
|
||||
for package in ${hurl_packages} ; do
|
||||
cargo_toml="packages/${package}/Cargo.toml"
|
||||
sed -i "s/^version.*/version = \"${{ needs.control-release.outputs.release_version }}\"/" "${cargo_toml}"
|
||||
sed -i "s/^version.*/version = \"${{ needs.set-context.outputs.release_version }}\"/" "${cargo_toml}"
|
||||
echo "----------------------------"
|
||||
echo " > package version for ${cargo_toml}"
|
||||
echo " $(grep "^version =" "${cargo_toml}")"
|
||||
for dep_package in ${hurl_packages} ; do
|
||||
if [ $(grep -c "^${dep_package} =" "${cargo_toml}") -gt 0 ] ; then
|
||||
sed -i "s/^${dep_package} = { version .*/${dep_package} = { version = \"${{ needs.control-release.outputs.release_version }}\", path = \"..\/${dep_package}\" }/" "${cargo_toml}"
|
||||
sed -i "s/^${dep_package} = { version .*/${dep_package} = { version = \"${{ needs.set-context.outputs.release_version }}\", path = \"..\/${dep_package}\" }/" "${cargo_toml}"
|
||||
echo " > ${dep_package} dep package version for ${cargo_toml}"
|
||||
echo " $(grep "^${dep_package} =" "${cargo_toml}")"
|
||||
fi
|
||||
@ -248,8 +242,8 @@ jobs:
|
||||
version_doc="docs/installation.md"
|
||||
old_version=$(grep "sudo dpkg -i" "${version_doc}" | cut --delimiter "_" --field 2 )
|
||||
echo "old_version=${old_version}"
|
||||
sed -i "s/${old_version}/${{ needs.control-release.outputs.release_version }}/g" "${version_doc}"
|
||||
grep "${{ needs.control-release.outputs.release_version }}" "${version_doc}"
|
||||
sed -i "s/${old_version}/${{ needs.set-context.outputs.release_version }}/g" "${version_doc}"
|
||||
grep "${{ needs.set-context.outputs.release_version }}" "${version_doc}"
|
||||
|
||||
- name: Update man
|
||||
run: |
|
||||
@ -265,12 +259,12 @@ jobs:
|
||||
|
||||
- name: Push create release commits
|
||||
run: |
|
||||
git commit -am "Create ${{ needs.control-release.outputs.release_version }} release"
|
||||
git commit -am "Create ${{ needs.set-context.outputs.release_version }} release"
|
||||
git push && git_exit_code=0 || git_exit_code=$?
|
||||
if [ ${git_exit_code} -eq 0 ] ; then
|
||||
echo " - ✅ commits pushed to ${{ needs.control-release.outputs.release_branch }}."
|
||||
echo " - ✅ commits pushed to ${{ needs.set-context.outputs.release_branch }}."
|
||||
else
|
||||
echo " - ❌ A problem occurs when attempting to push create relase commits to ${{ needs.control-release.outputs.release_branch }} branch."
|
||||
echo " - ❌ A problem occurs when attempting to push create relase commits to ${{ needs.set-context.outputs.release_branch }} branch."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -280,18 +274,18 @@ jobs:
|
||||
with:
|
||||
name: release-changelog
|
||||
path: |
|
||||
release_changelog.md
|
||||
release_changelog.md
|
||||
|
||||
package-release:
|
||||
needs:
|
||||
- set-context
|
||||
- clean-release
|
||||
- control-release
|
||||
- create-release-branch
|
||||
name: package-release
|
||||
if: github.event.inputs.deliver-github-release == 'true'
|
||||
uses: Orange-OpenSource/hurl/.github/workflows/package.yml@master
|
||||
uses: ./.github/workflows/package.yml
|
||||
with:
|
||||
branch: ${{ needs.control-release.outputs.release_branch }}
|
||||
branch: ${{ needs.set-context.outputs.release_branch }}
|
||||
|
||||
deliver-github-release:
|
||||
env:
|
||||
@ -299,8 +293,8 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
REPO: ${{ github.repository }}
|
||||
needs:
|
||||
- set-context
|
||||
- clean-release
|
||||
- control-release
|
||||
- create-release-branch
|
||||
- package-release
|
||||
name: deliver-github-release
|
||||
@ -310,7 +304,7 @@ jobs:
|
||||
- name: Checkout new release branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ needs.control-release.outputs.release_branch }}
|
||||
ref: ${{ needs.set-context.outputs.release_branch }}
|
||||
|
||||
- name: Init git credentials
|
||||
run: |
|
||||
@ -322,34 +316,34 @@ jobs:
|
||||
|
||||
- name: Push tag
|
||||
run: |
|
||||
git tag -a ${{ needs.control-release.outputs.release_version }} -m "Release ${{ needs.control-release.outputs.release_version }}"
|
||||
git tag -a ${{ needs.set-context.outputs.release_version }} -m "Release ${{ needs.set-context.outputs.release_version }}"
|
||||
git tag -n
|
||||
git push --tags && git_exit_code=0 || git_exit_code=$?
|
||||
if [ ${git_exit_code} -eq 0 ] ; then
|
||||
echo " - ✅ ${{ needs.control-release.outputs.release_version }} tag created."
|
||||
echo " - ✅ ${{ needs.set-context.outputs.release_version }} tag created."
|
||||
git fetch
|
||||
else
|
||||
echo " - ❌ A problem occurs when attempting to create ${{ needs.control-release.outputs.release_version }} tag."
|
||||
echo " - ❌ A problem occurs when attempting to create ${{ needs.set-context.outputs.release_version }} tag."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Deliver release
|
||||
run: |
|
||||
cat CHANGELOG.md | python3 bin/release/changelog_extract.py ${{ needs.control-release.outputs.release_version }} > release_changelog.md
|
||||
gh release create ${{ needs.control-release.outputs.release_version }} \
|
||||
--target ${{ needs.control-release.outputs.release_branch }} \
|
||||
cat CHANGELOG.md | python3 bin/release/changelog_extract.py ${{ needs.set-context.outputs.release_version }} > release_changelog.md
|
||||
gh release create ${{ needs.set-context.outputs.release_version }} \
|
||||
--target ${{ needs.set-context.outputs.release_branch }} \
|
||||
--notes-file release_changelog.md \
|
||||
--title ${{ needs.control-release.outputs.release_version }} \
|
||||
--title ${{ needs.set-context.outputs.release_version }} \
|
||||
--draft \
|
||||
artifacts/release-deb-x64-artifacts/hurl_"${{ needs.control-release.outputs.release_version }}"_amd64.deb \
|
||||
artifacts/release-generic-linux-x64-artifacts/hurl-"${{ needs.control-release.outputs.release_version }}"-x86_64-linux.tar.gz \
|
||||
artifacts/release-macos-x64-artifacts/hurl-"${{ needs.control-release.outputs.release_version }}"-x86_64-macos.tar.gz \
|
||||
artifacts/release-windows-x64-artifacts/hurl-"${{ needs.control-release.outputs.release_version }}"-win64-installer.exe \
|
||||
artifacts/release-windows-x64-artifacts/hurl-"${{ needs.control-release.outputs.release_version }}"-win64.zip && gh_exit_code=0 || gh_exit_code=$?
|
||||
artifacts/release-deb-x64-artifacts/hurl_"${{ needs.set-context.outputs.release_version }}"_amd64.deb \
|
||||
artifacts/release-generic-linux-x64-artifacts/hurl-"${{ needs.set-context.outputs.release_version }}"-x86_64-linux.tar.gz \
|
||||
artifacts/release-macos-x64-artifacts/hurl-"${{ needs.set-context.outputs.release_version }}"-x86_64-macos.tar.gz \
|
||||
artifacts/release-windows-x64-artifacts/hurl-"${{ needs.set-context.outputs.release_version }}"-win64-installer.exe \
|
||||
artifacts/release-windows-x64-artifacts/hurl-"${{ needs.set-context.outputs.release_version }}"-win64.zip && gh_exit_code=0 || gh_exit_code=$?
|
||||
if [ ${gh_exit_code} -eq 0 ] ; then
|
||||
echo " - ✅ Github release ${{ needs.control-release.outputs.release_version }} created."
|
||||
echo " - ✅ Github release ${{ needs.set-context.outputs.release_version }} created."
|
||||
else
|
||||
echo " - ❌ A problem occurs when attempting to create github release ${{ needs.control-release.outputs.release_version }}."
|
||||
echo " - ❌ A problem occurs when attempting to create github release ${{ needs.set-context.outputs.release_version }}."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -358,16 +352,15 @@ jobs:
|
||||
GITHUB_TOKEN=${{ secrets.LEPAPAREIL_CI_TOKEN }}
|
||||
{
|
||||
echo "⚠ This is a github releasing PR."
|
||||
echo "- Please \`/accept\` this PR only when github release ${{ needs.control-release.outputs.release_version }} is published"
|
||||
echo "- Please use \`/accept --release\` if you want to automatically update master branch to next SNAPSHOT version"
|
||||
} > file-body.txt
|
||||
gh pr create \
|
||||
--title "Merge Github ${{ needs.control-release.outputs.release_branch }} into master" \
|
||||
--title "Merge Github ${{ needs.set-context.outputs.release_branch }} into ${{ github.ref_name }}" \
|
||||
--body-file file-body.txt \
|
||||
--base master \
|
||||
--label bot && gh_exit_code=0 || gh_exit_code=$?
|
||||
if [ ${gh_exit_code} -eq 0 ] ; then
|
||||
new_pr_number=$(gh pr list --repo "${{ github.repository }}" --head "${{ needs.control-release.outputs.release_branch }}" --state "open" --json number --jq .[].number)
|
||||
new_pr_number=$(gh pr list --repo "${{ github.repository }}" --head "${{ needs.set-context.outputs.release_branch }}" --state "open" --json number --jq .[].number)
|
||||
echo " - ✅ Creation of pull request n°${new_pr_number} succeeds."
|
||||
else
|
||||
echo " - ❌ A problem occurs when attempting to create new pull request."
|
||||
|
4
.github/workflows/update-branch-version.yml
vendored
4
.github/workflows/update-branch-version.yml
vendored
@ -4,7 +4,7 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
new_version:
|
||||
description: 'Version (Major.Minor.Patch or Major.Minor.Patch-SNASPHOT)'
|
||||
description: 'Version (x.y.z-SNASPHOT)'
|
||||
required: true
|
||||
type: string
|
||||
workflow_call:
|
||||
@ -14,7 +14,7 @@ on:
|
||||
required: true
|
||||
inputs:
|
||||
new_version:
|
||||
description: "Version (Major.Minor.Patch or Major.Minor.Patch-SNASPHOT)"
|
||||
description: "Version (x.y.z-SNASPHOT)"
|
||||
required: true
|
||||
type: string
|
||||
branch:
|
||||
|
70
RELEASING.md
70
RELEASING.md
@ -1,33 +1,55 @@
|
||||
# Releasing Process
|
||||
|
||||
We are starting with current version x.y.0-snapshot (in Cargo.toml).
|
||||
|
||||
Releasing a new version of Hurl will create a release M.m.0
|
||||
and update master to M.(m+1).0-snapshot
|
||||
|
||||
## Steps
|
||||
|
||||
0. Create branch/PR release/M.m.0
|
||||
1. Update CHANGELOG from Issues/PR
|
||||
2. Update Cargo.toml (x3) remove -snapshot suffix and Cargo.lock
|
||||
3. Update version in docs/installations.md
|
||||
4. Regenerate man pages and README
|
||||
5. Commit
|
||||
6. Tag M.n.0
|
||||
7. Create GitHub Release
|
||||
8. Copy Changelog and upload artifacts
|
||||
9. Merge (Fast forward) release branch to master
|
||||
10. Increase Version in Cargo.toml to M.(m+1).0-snapshot
|
||||
11. Commit
|
||||
12. Upload packages to external package managers
|
||||
We always have to start with current version x.y.0-snapshot (in all Cargo.toml).
|
||||
|
||||
## CHANGELOG
|
||||
|
||||
- Issues are grouped into Changes (Enhancement) and Bug Fixes.
|
||||
- Use description from PR (starts with a verb)
|
||||
- Add link(s) to related issue(s)
|
||||
- Add enhancement or Bug label to the issue
|
||||
- Add target milestone to the issue
|
||||
- Use a well formatted description on PR (starts with a verb)
|
||||
- Add link(s) to the issue
|
||||
|
||||
## Release steps
|
||||
|
||||
- Run `release.yml` workflow on `master` branch, it will:
|
||||
- Clean pending release
|
||||
- Create new `release/x.y.0` branch
|
||||
- Checkout this new branch
|
||||
- Update all toml with `x.y.0`
|
||||
- Update all crate with `x.y.0`
|
||||
- Update man and docs with `x.y.0`
|
||||
- Generate CHANGELOG
|
||||
- Commit all updates
|
||||
- Create the `x.y.0` tag
|
||||
- Create draft github release `x.y.0`
|
||||
- Create PR from `release/x.y.0` to `master`
|
||||
- You have to `/accept --release` this PR, it will:
|
||||
- Merge fast-forward this PR
|
||||
- Open a new one to update `master` files to next version `x.y+1.0-SNAPSHOT`
|
||||
|
||||
## Hotfix steps
|
||||
|
||||
- Create a new branch `release/x.y.z` from desired tag `x.y.0`, for example `release/1.8.1` from tag `1.8.0`
|
||||
- Run `update-branch-version.yml` workflow on the new branch filling version field with `x.y.z-SNAPSHOT`, for example `1.8.1-SNAPSHOT` for `release/1.8.1` branch
|
||||
- Run release.yml workflow on `release/x.y.z` branch, it will:
|
||||
- Clean pending release
|
||||
- Checkout `release/x.y.z` branch
|
||||
- Update all toml with `x.y.z`
|
||||
- Update all crate with `x.y.z`
|
||||
- Update man and docs with `x.y.z`
|
||||
- Generate CHANGELOG
|
||||
- Commit all updates
|
||||
- Create the `x.y.z` tag
|
||||
- Create draft github release `x.y.z`
|
||||
- Create PR from `release/x.y.z` to `master`
|
||||
- You have to manually `merge` as a revert rebase to reorder commits between this new hotfix and master
|
||||
- Run `update-branch-version.yml` workflow on `master` to restore actual dev version to `x.y+1.0-SNAPSHOT`, for example from `1.8.1` to `1.9.0-SNAPSHOT`
|
||||
|
||||
## Additional
|
||||
|
||||
- push source packages (checkout tag) to crates.io
|
||||
- push package to chocolatey
|
||||
- push package to winget
|
||||
- push package to docker
|
||||
- push package to brew
|
||||
- push source packages to crates.io
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user