From 3595e73c9f6e82dc7729a06e50bfbb795941001b Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Wed, 30 Aug 2023 12:33:41 +0800 Subject: [PATCH] fix(version): fix release candidate version syntax --- ci/build.sh | 16 ++++++++++++++-- packages/openrc/nfpm.yaml | 1 + packages/runit/nfpm.yaml | 1 + packages/s6-overlay/nfpm.yaml | 1 + packages/supervisord/nfpm.yaml | 1 + packages/sysvinit-yocto/nfpm.yaml | 1 + packages/sysvinit/nfpm.yaml | 1 + 7 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ci/build.sh b/ci/build.sh index b030ed0..625b78c 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -86,7 +86,19 @@ build() { echo "----------------------------------------" for package_type in "${PACKAGE_TYPES[@]}"; do - nfpm package --config "$nfpm_file" -p "$package_type" -t "$output_dir" + PACKAGE_VERSION="" + RELEASE="" + case "$package_type" in + deb|rpm) + PACKAGE_VERSION="${SEMVER//-rc/~}" + ;; + apk) + PACKAGE_VERSION="${SEMVER//\-/_}" + RELEASE="r0" + ;; + esac + echo "Packaging $package_type using version $PACKAGE_VERSION" + env SEMVER="$PACKAGE_VERSION" RELEASE="$RELEASE" nfpm package --config "$nfpm_file" -p "$package_type" -t "$output_dir" done # create tarball (use deb file as the reference) @@ -96,7 +108,7 @@ build() { echo "WARNING: Could not find the debian file. dir=$output_dir" >&2 fi - TARBALL="$(echo "${DEB_FILE%.*}.tar.gz" | sed 's/_all//g')" + TARBALL="$(echo "${DEB_FILE%.*}.tar.gz" | sed 's/_all//g' | sed 's/~/-rc/g')" ar x "$DEB_FILE" data.tar.gz mv data.tar.gz "$TARBALL" echo "created tarball: $TARBALL" diff --git a/packages/openrc/nfpm.yaml b/packages/openrc/nfpm.yaml index 1007220..ad8211c 100644 --- a/packages/openrc/nfpm.yaml +++ b/packages/openrc/nfpm.yaml @@ -4,6 +4,7 @@ name: tedge-openrc arch: all platform: linux version: ${SEMVER} +release: ${RELEASE} section: misc priority: optional maintainer: thin-edge.io diff --git a/packages/runit/nfpm.yaml b/packages/runit/nfpm.yaml index 0c012f3..0523c20 100644 --- a/packages/runit/nfpm.yaml +++ b/packages/runit/nfpm.yaml @@ -4,6 +4,7 @@ name: tedge-runit arch: all platform: linux version: ${SEMVER} +release: ${RELEASE} section: misc priority: optional maintainer: thin-edge.io diff --git a/packages/s6-overlay/nfpm.yaml b/packages/s6-overlay/nfpm.yaml index 8c999ec..3c79779 100644 --- a/packages/s6-overlay/nfpm.yaml +++ b/packages/s6-overlay/nfpm.yaml @@ -4,6 +4,7 @@ name: tedge-s6overlay arch: all platform: linux version: ${SEMVER} +release: ${RELEASE} section: misc priority: optional maintainer: thin-edge.io diff --git a/packages/supervisord/nfpm.yaml b/packages/supervisord/nfpm.yaml index 8a71e70..ef8906f 100644 --- a/packages/supervisord/nfpm.yaml +++ b/packages/supervisord/nfpm.yaml @@ -4,6 +4,7 @@ name: tedge-supervisord arch: all platform: linux version: ${SEMVER} +release: ${RELEASE} section: misc priority: optional maintainer: thin-edge.io diff --git a/packages/sysvinit-yocto/nfpm.yaml b/packages/sysvinit-yocto/nfpm.yaml index f2c50fd..23d9e96 100644 --- a/packages/sysvinit-yocto/nfpm.yaml +++ b/packages/sysvinit-yocto/nfpm.yaml @@ -4,6 +4,7 @@ name: tedge-sysvinit-yocto arch: all platform: linux version: ${SEMVER} +release: ${RELEASE} section: misc priority: optional maintainer: thin-edge.io diff --git a/packages/sysvinit/nfpm.yaml b/packages/sysvinit/nfpm.yaml index 240e918..1b690e7 100644 --- a/packages/sysvinit/nfpm.yaml +++ b/packages/sysvinit/nfpm.yaml @@ -4,6 +4,7 @@ name: tedge-sysvinit arch: all platform: linux version: ${SEMVER} +release: ${RELEASE} section: misc priority: optional maintainer: thin-edge.io