Skip to content

Commit

Permalink
Merge pull request #22 from bigbluebutton/release
Browse files Browse the repository at this point in the history
Build system improvements
  • Loading branch information
kepstin authored Mar 5, 2023
2 parents 91b19dc + e898329 commit 3f20bd9
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 22 deletions.
17 changes: 1 addition & 16 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,7 @@ jobs:
UBUNTU_VERSION: ${{ matrix.UBUNTU_VERSION }}
run: |
cd source
DPKG_VERSION=$(dpkg-parsechangelog -S version)
DPKG_DISTRIBUTION=$(dpkg-parsechangelog -S distribution)
GIT_SEPARATOR='+'
DCH_BACKPORT=
if [[ $DPKG_DISTRIBUTION == UNRELEASED ]]; then
GIT_SEPARATOR='~0+'
elif [[ $DPKG_DISTRIBUTION != $UBUNTU_CODENAME ]]; then
DCH_BACKPORT="~$UBUNTU_VERSION"
fi
GIT_DESCRIBE=$(git describe --tags)
GIT_TAG=$(git describe --tags --abbrev=0)
GIT_EXTRA=${GIT_DESCRIBE#${GIT_TAG}}
GIT_EXTRA=${GIT_EXTRA/-/$GIT_SEPARATOR}
GIT_EXTRA=${GIT_EXTRA//-/.}
DCH_VERSION="${DPKG_VERSION}${DCH_BACKPORT}${GIT_EXTRA}"
echo "DCH_VERSION=${DCH_VERSION}" | tee -a $GITHUB_ENV
eval "$(./dch_version.sh | tee -a "${GITHUB_ENV}")"
dch --newversion "${DCH_VERSION}" --force-bad-version --distribution "${UBUNTU_CODENAME}" "Automatic Build"
- name: Cleanup .github directory
Expand Down
30 changes: 30 additions & 0 deletions dch_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# This is a tool to convert a semver 2.0.0 compatible version to a format which
# is compatible with both debian packaging tools and - after the transformations
# applied in debian pybuild - python PEP 440. It should generate the same python
# package version as is generated by setuptools_scm's "post-release" scheme.
GIT_TAG=$(git describe --tags --abbrev=0 "$@")
GIT_DESCRIBE=$(git describe --tags --long --dirty=.d$(date +%Y%m%d) "$@")
GIT_EXTRA="${GIT_DESCRIBE#${GIT_TAG}}"
GIT_TAG="${GIT_TAG//-/'~'}"
GIT_TAG="${GIT_TAG//alpha./alpha}"
GIT_TAG="${GIT_TAG//beta./beta}"
GIT_TAG="${GIT_TAG//rc./rc}"
DCH_VERSION="${GIT_TAG}"

GIT_EXTRA="${GIT_EXTRA#-}"
GIT_DISTANCE="${GIT_EXTRA%%-*}"
GIT_BUILD="${GIT_EXTRA#${GIT_DISTANCE}-}"
GIT_BUILD_HASH="${GIT_BUILD%%.*}"
if [[ $GIT_DISTANCE == 0 ]]; then
GIT_BUILD="${GIT_BUILD#${GIT_BUILD_HASH}}"
GIT_BUILD="${GIT_BUILD#.}"
fi
if [[ -n $GIT_BUILD ]]; then
DCH_VERSION+=".post${GIT_DISTANCE}+${GIT_BUILD}"
elif [[ $GIT_DISTANCE != 0 ]]; then
DCH_VERSION+=".post${GIT_DISTANCE}"
fi

echo "DCH_VERSION=${DCH_VERSION@Q}"
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# SPDX-License-Identifier: LGPL-3.0-or-later

[build-system]
requires = ["setuptools >= 42", "setuptools_scm[toml] >= 3.4"]
requires = ["setuptools >= 45.2", "setuptools_scm[toml] >= 3.4"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "post-release"

[tool.black]
target-version = ["py38"]
Expand Down
7 changes: 4 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Build system requires (keep in sync with pyproject.toml)
setuptools >= 45.2
setuptools_scm[toml] >= 3.4
# Install requires (keep in sync with setup.cfg)
# Specific versions are used here to match Ubuntu 20.04
setuptools == 45.2.0
setuptools_scm == 3.4.3
# Specific versions are used here for dev env to match Ubuntu 20.04
attrs == 19.3.0
lxml == 4.5.0
packaging == 20.3
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ install_requires =
sortedcollections >= 1.0.1
perfect-freehand >= 1.2.0


[options.packages.find]
include =
bbb_presentation_video
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
from setuptools import setup

setup(
use_scm_version=True,
use_scm_version={"version_scheme": "post-release"},
)

0 comments on commit 3f20bd9

Please sign in to comment.