@cryptotaxi247 / netdata-1 / commits / dc5f3b562

Fix handling of nightly and release packages in GHA workflows. (#10819)

Austin S. Hemmelgarn committed Mar 19, 2021 at 09:03 UTC dc5f3b562f4efdd5b8dea5a5271923af0e05363b
2 files changed +11 -5
.github/workflows/packaging.yml
+2 -2
@@ -110,7 +110,7 @@ jobs:
110 mkdir -p artifacts
111 docker run --platform ${{ matrix.platform }} -v $PWD/artifacts:/artifacts local/package-builder:${{ matrix.distro }}${{ matrix.version }}
112 - name: Upload
113 - if: github.env.runtype == 'release' || github.env.runtype == 'nightly' || github.env.runtype == 'devel'
113 + if: github.event_name == 'workflow_dispatch'
114 shell: bash
115 run: |
116 # This figures out the distribution ID for the upload.
@@ -120,7 +120,7 @@ jobs:
120 -F "package[package_file]=@${pkgfile}" \
121 https://${{ secrets.PACKAGE_CLOUD_API_TOKEN }}:@packagecloud.io/api/v1/repos/${{ env.repo }}/packages.json || exit 1
122 - name: Clean
123 - if: github.env.runtype == 'release' || github.env.runtype == 'nightly' || github.env.runtype == 'devel'
123 + if: github.event_name == 'workflow_dispatch'
124 shell: bash
125 env:
126 REPO: ${{ env.repo }}
packaging/scripts/install.sh
+9 -3
@@ -20,8 +20,10 @@ install_fedora_like() {
20
21 PKGMGR="$( (command -v dnf > /dev/null && echo "dnf") || echo "yum")"
22
23 + pkg_version="$(echo "${VERSION}" | tr - .)"
24 +
25 # Install NetData
24 - "$PKGMGR" install -y /artifacts/netdata-"${VERSION}"-*.rpm
26 + "$PKGMGR" install -y /artifacts/netdata-"${pkg_version}"-*.rpm
27
28 # Install testing tools
29 "$PKGMGR" install -y curl nc jq
@@ -33,11 +35,13 @@ install_centos() {
35
36 PKGMGR="$( (command -v dnf > /dev/null && echo "dnf") || echo "yum")"
37
38 + pkg_version="$(echo "${VERSION}" | tr - .)"
39 +
40 # Install EPEL (needed for `jq`
41 "$PKGMGR" install -y epel-release
42
43 # Install NetData
40 - "$PKGMGR" install -y /artifacts/netdata-"${VERSION}"-*.rpm
44 + "$PKGMGR" install -y /artifacts/netdata-"${pkg_version}"-*.rpm
45
46 # Install testing tools
47 "$PKGMGR" install -y curl nc jq
@@ -47,10 +51,12 @@ install_suse_like() {
51 # Using a glob pattern here because I can't reliably determine what the
52 # resulting package name will be (TODO: There must be a better way!)
53
54 + pkg_version="$(echo "${VERSION}" | tr - .)"
55 +
56 # Install NetData
57 # FIXME: Allow unsigned packages (for now) #7773
58 zypper install -y --allow-unsigned-rpm \
53 - /artifacts/netdata-"${VERSION}"-*.rpm
59 + /artifacts/netdata-"${pkg_version}"-*.rpm
60
61 # Install testing tools
62 zypper install -y --no-recommends \