diff --git a/.github/workflows/job-build-raspberry-pi.yaml b/.github/workflows/job-build-raspberry-pi.yaml index 7716edcad..2568c01e9 100644 --- a/.github/workflows/job-build-raspberry-pi.yaml +++ b/.github/workflows/job-build-raspberry-pi.yaml @@ -62,7 +62,7 @@ jobs: SYNERGY_VERSION_STAGE: ${{ steps.version.outputs.SYNERGY_VERSION_STAGE }} run: | sed -i "s/ synergy/ ${PACKAGE_NAME}/g" ./debian/control - dch --create --package "${PACKAGE_NAME}" --controlmaint --distribution unstable --newversion $SYNERGY_DEB_VERSION "Initial release" + python3 CI/deb_changelog.py "${PACKAGE_NAME}" "$(SYNERGY_DEB_VERSION)" debuild --preserve-envvar SYNERGY_* --preserve-envvar GIT_COMMIT -us -uc mkdir -p package cd .. diff --git a/CI/Linux/linux-build.yml b/CI/Linux/linux-build.yml index 4f869fa7f..5ace4781f 100644 --- a/CI/Linux/linux-build.yml +++ b/CI/Linux/linux-build.yml @@ -95,7 +95,7 @@ steps: displayName: "Setup variables" - script: | - dch --create --package "synergy" --controlmaint --distribution unstable --newversion $SYNERGY_DEB_VERSION "Initial release" + python3 CI/deb_changelog.py synergy "$(SYNERGY_DEB_VERSION)" export GPG_TTY=$(tty) debuild --preserve-envvar SYNERGY_* --preserve-envvar GIT_COMMIT -us -uc mkdir standard_package @@ -115,7 +115,7 @@ steps: - script: | export SYNERGY_ENTERPRISE=1 - dch --create --package "synergy-enterprise_" --controlmaint --distribution unstable --newversion $(SYNERGY_DEB_VERSION) "Initial release" + python3 CI/deb_changelog.py synergy-enterprise "$(SYNERGY_DEB_VERSION)" export GPG_TTY=$(tty) debuild --preserve-envvar SYNERGY_* --preserve-envvar GIT_COMMIT -us -uc mkdir enterprise_package @@ -135,7 +135,7 @@ steps: - script: | export SYNERGY_BUSINESS=1 - dch --create --package "synergy-business_" --controlmaint --distribution unstable --newversion $(SYNERGY_DEB_VERSION) "Initial release" + python3 CI/deb_changelog.py synergy-business "$(SYNERGY_DEB_VERSION)" export GPG_TTY=$(tty) debuild --preserve-envvar SYNERGY_* --preserve-envvar GIT_COMMIT -us -uc mkdir business_package diff --git a/CI/deb_changelog.py b/CI/deb_changelog.py new file mode 100644 index 000000000..aaef5b477 --- /dev/null +++ b/CI/deb_changelog.py @@ -0,0 +1,38 @@ +from argparse import ArgumentParser +from datetime import datetime, timezone + +IGNORE_SEGMENTS = ['Github Actions:'] + +if __name__ == '__main__': + parser = ArgumentParser() + parser.add_argument('name', type=str, help='Name of the package') + parser.add_argument('version', type=str, help='Version of the package') + parser.add_argument('-d', '--distribution', type=str, default='unstable', help='Distribution the package is built for') + parser.add_argument('-u', '--urgency', type=str, default='low', help='Urgency of the package') + args = parser.parse_args() + build_time = datetime.now(timezone.utc).strftime('%a, %d %b %Y %H:%M:%S %z') # day-of-week, dd month yyyy hh:mm:ss +zzzz + with open('ChangeLog', 'r') as in_file, open('debian/changelog', 'w+') as out_file: + out_file.write(f'{args.name} ({args.version}) {args.distribution}; urgency={args.urgency}\n') + in_section = False + ignore_segment = False + + while line := in_file.readline(): + if line.startswith('v'): + if line.startswith(f'v{args.version}'): + in_section = True + elif in_section: + break + elif not in_section: + continue + elif line.strip().replace('=', '') == '': + ignore_segment = False + elif line.strip() in IGNORE_SEGMENTS: + ignore_segment = True + elif line.strip().endswith(':'): + out_file.write(f'\n * {line.strip()[:-1]}') + else: + if in_section and not ignore_segment: + while line.startswith(('#', '|', '-')): + line = ' '.join(line.split()[1:]) + out_file.write(f'\n - {line}') + out_file.write(f'\n\n -- Symless {build_time}') diff --git a/ChangeLog b/ChangeLog index 0e65d8ce5..f0d0f66df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ Github Actions: - #7156 Change binary storage server - #7161 Use brew bundle to install dependencies - #7162 Add new distributions to CI +- #7167 Use changelog when creating deb files =========== v1.14.3-snapshot diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 000000000..ab1240797 --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,2 @@ +file-without-copyright-information +binary-without-manpage