summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2022-03-11 08:59:08 -0500
committerGitHub <noreply@github.com>2022-03-11 08:59:08 -0500
commit5fdcd854ec809079a59173d1d13ea28eb7fb92e6 (patch)
tree5b05e319a6bece4c330487c509024152ec95d84b
parent739e8a10a39507e81edc7e7d659b00d76bb8a489 (diff)
Fix version handling issues in release workflow. (#12375)
* Pass `nightly` instead of a version for nightly builds. * Use the correct name for the version input when triggering builds. * Properly pull the version info for nightly builds in the packaging workflow.
-rwxr-xr-x.github/scripts/prepare-release-base.sh7
-rw-r--r--.github/workflows/packaging.yml4
-rw-r--r--.github/workflows/release.yml6
3 files changed, 9 insertions, 8 deletions
diff --git a/.github/scripts/prepare-release-base.sh b/.github/scripts/prepare-release-base.sh
index 33235946f2..9044772267 100755
--- a/.github/scripts/prepare-release-base.sh
+++ b/.github/scripts/prepare-release-base.sh
@@ -108,6 +108,7 @@ elif [ "${EVENT_NAME}" = 'schedule' ] || [ "${EVENT_TYPE}" = 'nightly' ]; then
echo "::set-output name=ref::master"
echo "::set-output name=type::nightly"
echo "::set-output name=branch::master"
+ echo "::set-output name=version::nightly"
elif [ "${EVENT_TYPE}" = 'patch' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
echo "::notice::Preparing a patch release build."
check_version_format || exit 1
@@ -127,6 +128,7 @@ elif [ "${EVENT_TYPE}" = 'patch' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
echo "::set-output name=ref::${EVENT_VERSION}"
echo "::set-output name=type::release"
echo "::set-output name=branch::${branch_name}"
+ echo "::set-output name=version::$(tr -d 'v' < packaging/version)"
elif [ "${EVENT_TYPE}" = 'minor' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
echo "::notice::Preparing a minor release build."
check_version_format || exit 1
@@ -147,6 +149,7 @@ elif [ "${EVENT_TYPE}" = 'minor' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
echo "::set-output name=ref::${EVENT_VERSION}"
echo "::set-output name=type::release"
echo "::set-output name=branch::${branch_name}"
+ echo "::set-output name=version::$(tr -d 'v' < packaging/version)"
elif [ "${EVENT_TYPE}" = 'major' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
echo "::notice::Preparing a major release build."
check_version_format || exit 1
@@ -160,10 +163,8 @@ elif [ "${EVENT_TYPE}" = 'major' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
echo "::set-output name=ref::${EVENT_VERSION}"
echo "::set-output name=type::release"
echo "::set-output name=branch::master"
+ echo "::set-output name=version::$(tr -d 'v' < packaging/version)"
else
echo '::error::Unrecognized release type or invalid version.'
exit 1
fi
-
-# shellcheck disable=SC2002
-echo "::set-output name=version::$(cat packaging/version | sed 's/^v//' packaging/version)"
diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml
index d2c01ac401..e0e469118a 100644
--- a/.github/workflows/packaging.yml
+++ b/.github/workflows/packaging.yml
@@ -121,7 +121,7 @@ jobs:
;;
"nightly")
echo "::set-output name=repo::${REPO_PREFIX}-edge"
- echo "::set-output name=version::${{ github.event.inputs.version }}"
+ echo "::set-output name=version::$(tr -d 'v' < packaging/version)"
echo "::set-output name=retention::30"
;;
*)
@@ -131,7 +131,7 @@ jobs:
;;
esac
else
- echo "::set-output name=version::$(cut -d'-' -f 1 packaging/version | sed -e 's/^v//')"
+ echo "::set-output name=version::$(cut -d'-' -f 1 packaging/version | tr -d 'v')"
echo "::set-output name=retention::0"
fi
- name: Failure Notification
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 178f2f6819..1e435ea02b 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -119,7 +119,7 @@ jobs:
repo: ${{ github.repository }}
workflow: Build
ref: ${{ needs.update-changelogs.outputs.ref }}
- inputs: '{"agent_version": "${{ needs.update-changelogs.outputs.version }}", "type": "${{ github.event.inputs.type }}"}'
+ inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}", "type": "${{ github.event.inputs.type }}"}'
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env:
@@ -154,7 +154,7 @@ jobs:
repo: ${{ github.repository }}
workflow: Docker
ref: ${{ needs.update-changelogs.outputs.ref }}
- inputs: '{"agent_version": "${{ needs.update-changelogs.outputs.version }}"}'
+ inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}"}'
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env:
@@ -189,7 +189,7 @@ jobs:
repo: ${{ github.repository }}
workflow: Packages
ref: ${{ needs.update-changelogs.outputs.ref }}
- inputs: '{"agent_version": "${{ needs.update-changelogs.outputs.version }}", "type": "${{ github.event.inputs.type }}"}'
+ inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}", "type": "${{ github.event.inputs.type }}"}'
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env: