Skip to content

Commit

Permalink
ci: Upload: Reset tarball name to include version (#79)
Browse files Browse the repository at this point in the history
Restore the tarball filename to match the spec at
https://github.com/leamas/opencpn/wiki/Tarballs#tarball-names.
In particular, include the version in the generated filename.

Closes: #79
  • Loading branch information
Alec Leamas committed Mar 22, 2020
1 parent 73ed26e commit 7716d63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ MESSAGE (STATUS "*** Building ${PACKAGE_NAME} ***")
include("VERSION.cmake")
SET(PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )

SET(PKG_RELEASE "3")
SET(PKG_RELEASE "4")
SET(PKG_API_VERSION "1.16")
SET(PKG_AUTHOR "David S Register")

# NVR: Name-version-release
SET(PKG_NVR ${PACKAGE_NAME}-${PACKAGE_VERSION}-${PKG_RELEASE})

# The @keyword@ references are patched to actual values by upload script.
Expand All @@ -48,7 +50,7 @@ SET(OCPN_MIN_VERSION "ov50")
#OPTION(OCPN_USE_API_16 "Use plugin api 16 (default: api 13)." OFF)
OPTION(OCPN_FLATPAK "Build flatpak plugin" OFF)

set(PLUGIN_NAME oesenc-plugin-${PKG_TARGET}-${PKG_TARGET_VERSION})
set(PLUGIN_NAME ${PKG_NVR}_${PKG_TARGET}-${PKG_TARGET_VERSION})

IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release CACHE STRING
Expand Down
14 changes: 2 additions & 12 deletions ci/circleci-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,14 @@ tag=$(git tag --contains HEAD)
xml=$(ls $HOME/project/build/*.xml)
tarball=$(ls $HOME/project/build/*.tar.gz)
tarball_basename=${tarball##*/}
tarball_name=${tarball_basename%.tar.gz}

# extract the project name for a filename. e.g. oernc-pi... sets PROJECT to "oernc"
echo "Check 1"
#pwd
cd build
ls *.xml
PROJECT=$(ls *.xml | awk '{split($0,a,"-"); print a[1]}')
cd ..
echo $PROJECT
echo $xml
PROJECT=${tarball_basename%%_pi*}

source $HOME/project/build/pkg_version.sh
test -n "$tag" && VERSION="$tag" || VERSION="${VERSION}.${commit}"
test -n "$tag" && REPO="$STABLE_REPO" || REPO="$UNSTABLE_REPO"
tarball_name=${PROJECT}-${PKG_TARGET}-${PKG_TARGET_VERSION}-tarball
xml_name=${PROJECT}-plugin-${PKG_TARGET}-${PKG_TARGET_VERSION}.xml
echo $xml_name


sudo sed -i -e "s|@pkg_repo@|$REPO|" $xml
sudo sed -i -e "s|@name@|$tarball_name|" $xml
Expand Down

0 comments on commit 7716d63

Please sign in to comment.