Skip to content

Commit

Permalink
Add debian packaging files
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeChenL committed Dec 27, 2023
1 parent 491532d commit 0560f70
Show file tree
Hide file tree
Showing 18 changed files with 248 additions and 79 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
79 changes: 0 additions & 79 deletions .github/workflows/build.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/new_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Create release
on:
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
token: ${{secrets.GIT_PUSH_TOKEN}}
- name: Create release commit
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y git-buildpackage
export DEBEMAIL="[email protected]"
export DEBFULLNAME='"Radxa Computer Co., Ltd"'
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
make dch
- name: Test
run: |
sudo apt-get update
sudo apt-get build-dep --no-install-recommends -y .
make deb
- name: Push
run: |
git push
98 changes: 98 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build & Release
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Test
run: |
make deb
- name: Build
run: |
sudo apt-get update
sudo apt-get build-dep --no-install-recommends -y .
make deb
- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: |
${{ env.artifacts_path }}/*.deb
release:
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name == 'workflow_dispatch' && github.ref_name == 'main' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}
- name: Check if the latest version is releasable
run: |
version="$(dpkg-parsechangelog -S Version)"
echo "version=$version" >> $GITHUB_ENV
echo "changes<<EOF" >> $GITHUB_ENV
echo '```' >> $GITHUB_ENV
echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV
echo '```' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
if [[ -n "$(git tag -l "$version")" ]]
then
echo "distro=UNRELEASED" >> $GITHUB_ENV
else
echo "distro=$(dpkg-parsechangelog -S Distribution)" >> $GITHUB_ENV
fi
echo "$version" > VERSION
if [[ -f pkg.conf.template ]]
then
sed "s/VERSION/$(dpkg-parsechangelog -S Version)/g" pkg.conf.template > pkg.conf
fi
- name: Release
if: env.distro != 'UNRELEASED'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.version }}
body_path: README.md
token: ${{ secrets.GITHUB_TOKEN }}
target_commitish: master
draft: false
fail_on_unmatched_files: true
files: |
*.deb
VERSION
- name: Append changelog
if: env.distro != 'UNRELEASED'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.version }}
body: |
## Changelog for ${{ env.version }}
${{ env.changes }}
append_body: true
- name: Update Test repos
if: env.distro != 'UNRELEASED'
uses: radxa-repo/update-repo-action@main
with:
test-repo: true
token: ${{ secrets.RADXA_APT_TEST_REPO_TOKEN }}
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ distclean: clean
.PHONY: clean
clean:
rm -rf $(DTBO) $(TMP)

#
# Release
#
.PHONY: dch
dch: debian/changelog
gbp dch --debian-branch=main


.PHONY: deb
deb: debian
debuild --no-lintian --lintian-hook "lintian --fail-on error,warning --suppress-tags bad-distribution-in-changes-file -- %p_%v_*.changes" --no-sign -b
2 changes: 2 additions & 0 deletions SOURCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git clone https://github.com/radxa/overlays.git
git checkout 491532d1cb65b7fa4c398e53a679e0784ffb347b
7 changes: 7 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.debhelper
/debhelper-build-stamp
/files
/radxa-overlays-dkms
/*.debhelper.log
/*.debhelper
/*.substvars
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
radxa-overlays-dkms (1.0.0-1) UNRELEASED; urgency=medium

* Initial release

-- "Radxa Computer Co., Ltd" <[email protected]> Wed, 27 Dec 2023 14:08:37 +0800
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
17 changes: 17 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Source: radxa-overlays-dkms
Maintainer: "Radxa Computer Co., Ltd" <[email protected]>
Section: misc
Priority: optional
Standards-Version: 4.6.0
Build-Depends: debhelper (>=12~),
devscripts,
dh-sequence-dkms,
lintian,

Package: radxa-overlays-dkms
Architecture: all
Section: misc
Priority: optional
Depends: ${misc:Depends},
Description: dkms sources for radxa/overlay
This package provides the dkms source code for radxa/overlay.
26 changes: 26 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: overlay
Source: https://github.com/radxa-pkg/overlay

Files: *
Copyright: © 2022 Radxa Computer Co., Ltd
License: GPL-3+

License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301, USA.
.
On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3.
7 changes: 7 additions & 0 deletions debian/dkms
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PACKAGE_NAME="radxa-overlays-dkms"
PACKAGE_VERSION="#MODULE_VERSION#"
DEST_MODULE_LOCATION[0]="/kernel"
MAKE="make all"
CLEAN="make clean"
AUTOINSTALL="yes"
FORCE=true
1 change: 1 addition & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SOURCE
2 changes: 2 additions & 0 deletions debian/lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# We do not track this on GitHub
radxa-overlays-dkms: initial-upload-closes-no-bugs
24 changes: 24 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

%:
dh $@

override_dh_install:
dh_install -p radxa-overlays-dkms arch usr/src/radxa-overlays-dkms-$(DEB_VERSION)
dh_install -p radxa-overlays-dkms radxa-overlays-dkms.ko usr/src/radxa-overlays-dkms-$(DEB_VERSION)
dh_install -p radxa-overlays-dkms Makefile usr/src/radxa-overlays-dkms-$(DEB_VERSION)

override_dh_dkms:
dh_dkms -V $(DEB_VERSION)

override_dh_builddeb:
dh_builddeb -- -Zxz

override_dh_lintian:
dh_lintian
override_dh_auto_build:
echo "disable dh_auto_build"

1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
4 changes: 4 additions & 0 deletions debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Our package is built on GitHub-hosted runner,
# which uses Ubuntu, and will default to zstd compression.
# This is currently not supported in Debian.
radxa-overlays-dkms source: custom-compression-in-debian-rules
Empty file added radxa-overlays-dkms.ko
Empty file.

0 comments on commit 0560f70

Please sign in to comment.