From 809371096327dc8b976be8d7552ede7821e16dd2 Mon Sep 17 00:00:00 2001 From: JordanKeo45 Date: Fri, 8 Mar 2024 13:24:46 -0400 Subject: [PATCH] packaging --- .github/workflows/build-packages.yml | 40 +++++++++++++++ CHANGELOG.md | 3 ++ manifest.json | 73 +++++++++++++++++++--------- packaging/el8/main.spec | 30 ++++++++++++ packaging/focal/changelog | 5 ++ packaging/focal/control | 12 +++++ packaging/focal/copyright | 23 +++++++++ packaging/focal/rules | 23 +++++++++ packaging/focal/source/format | 1 + 9 files changed, 188 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/build-packages.yml create mode 100644 CHANGELOG.md create mode 100644 packaging/el8/main.spec create mode 100644 packaging/focal/changelog create mode 100644 packaging/focal/control create mode 100644 packaging/focal/copyright create mode 100755 packaging/focal/rules create mode 100644 packaging/focal/source/format diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml new file mode 100644 index 0000000..b80c985 --- /dev/null +++ b/.github/workflows/build-packages.yml @@ -0,0 +1,40 @@ +name: Build Packages +on: + push: + branches: + - build + tags: + - 'v*.*.*' +jobs: + main: + runs-on: self-hosted + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Package Binaries + run: build-packages ${{github.repository}} ${{github.workspace}} + - name: Set Variables + if: startsWith(github.ref, 'refs/tags/') + run: | + echo "PRERELEASE=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.prerelease')" >> $GITHUB_ENV + echo "TITLE=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.title')" >> $GITHUB_ENV + echo "VERSION=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.version')" >> $GITHUB_ENV + echo "REVISION=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.buildVersion')" >> $GITHUB_ENV + - name: GitHub Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + name: ${{env.TITLE}} ${{env.VERSION}} + prerelease: ${{env.PRERELEASE}} + body_path: ${{github.workspace}}/CHANGELOG.md + files: | + ${{github.workspace}}/dist/packages/*/*.deb + ${{github.workspace}}/dist/packages/*/*.rpm + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Update Repository + if: startsWith(github.ref, 'refs/tags/') + run: update-repositories ${{github.workspace}} + - name: Publish Repository + if: startsWith(github.ref, 'refs/tags/') + run: publish-repo \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0417a09 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## cockpit zfs 0.1.0-1 + +* initial release \ No newline at end of file diff --git a/manifest.json b/manifest.json index 7360b58..250af44 100644 --- a/manifest.json +++ b/manifest.json @@ -1,38 +1,67 @@ { - "__version": "45D-R1", + "__version": "45D-R2", "name": "cockpit-zfs", - "title": "Cockpit ZFS Module", - "prerelease": false, - "version": "0.0.0", - "buildVersion": "0", + "title": "cockpit zfs", + "prerelease": true, + "version": "0.1.0", + "buildVersion": "1", "author": "Jordan Keough ", - "url": "", + "url": "https://github.com/45Drives/cockpit-zfs", "category": "utils", "priority": "optional", "licence": "GPL-3.0+", "architecture": { - "deb": "all" + "deb": "all", + "el": "noarch" }, "description": { - "long": "ZFS Pool Manager for Cockpit", - "short": "ZFS Pool Manager for Cockpit" + "long": "zfs manager for cockpit", + "short": "zfs manager for cockpit" }, "defaults": { "urgency": "medium" }, "dependencies": { - "deb": [ - "cockpit", - "attr", - "coreutils", - "libc-bin", - "nfs-kernel-server", - "samba", - "samba-common-bin", - "systemd", - "winbind", - "gawk", - "mbuffer" - ] + "deb": { + "bionic": [ + "cockpit", + "python3" + ], + "focal": [ + "cockpit", + "python3" + ] + }, + "el": { + "el7": [ + "cockpit", + "python3" + ], + "el8": [ + "cockpit", + "python3" + ] + } + }, + "releases": [ + { + "image": "ubuntu-focal-builder", + "codeName": "focal", + "type": "deb" + }, + { + "image": "rocky-el8-builder", + "codeName": "el8", + "type": "el" + } + ], + "changelog": { + "urgency": "medium", + "version": "0.1.0", + "buildVersion": "1", + "ignore": [], + "date": null, + "packager": "Jordan Keough ", + "changes": [] } } \ No newline at end of file diff --git a/packaging/el8/main.spec b/packaging/el8/main.spec new file mode 100644 index 0000000..0524842 --- /dev/null +++ b/packaging/el8/main.spec @@ -0,0 +1,30 @@ +Name: ::package_name:: +Version: ::package_version:: +Release: ::package_build_version::%{?dist} +Summary: ::package_description_short:: +License: ::package_licence:: +URL: ::package_url:: +Source0: %{name}-%{version}.tar.gz +BuildArch: ::package_architecture_el:: +Requires: ::package_dependencies_el:: + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +%description +::package_title:: +::package_description_long:: + +%prep +%setup -q + +%build + +%install +make DESTDIR=%{buildroot} install + +%files +/usr/share/cockpit/package-name/* + +%changelog +* Fri Mar 08 2024 Jordan Keough 0.1.0-1 +- initial release \ No newline at end of file diff --git a/packaging/focal/changelog b/packaging/focal/changelog new file mode 100644 index 0000000..44a93a4 --- /dev/null +++ b/packaging/focal/changelog @@ -0,0 +1,5 @@ +cockpit-zfs (0.1.0-1focal) focal; urgency=medium + + * initial release + + -- Jordan Keough Fri, 08 Mar 2024 09:23:59 -0400 \ No newline at end of file diff --git a/packaging/focal/control b/packaging/focal/control new file mode 100644 index 0000000..d9bdb6a --- /dev/null +++ b/packaging/focal/control @@ -0,0 +1,12 @@ +Source: ::package_name:: +Section: ::package_category:: +Priority: ::package_priority:: +Maintainer: ::package_author:: +Build-Depends: debhelper-compat (= 12) +Standards-Version: 4.4.1 +Homepage: ::package_url:: + +Package: ::package_name:: +Architecture: ::package_architecture_deb:: +Depends: ::package_dependencies_deb:: +Description: ::package_description_short:: diff --git a/packaging/focal/copyright b/packaging/focal/copyright new file mode 100644 index 0000000..492ab17 --- /dev/null +++ b/packaging/focal/copyright @@ -0,0 +1,23 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ::package_name:: +Upstream-Contact: ::package_author:: +Source: ::package_url:: + +Files: * +Copyright: 2021 Your Name +License: GPL-3.0+ + +License: GPL-3.0+ + 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 of the License, 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 the Onboard package. If not, please have a look at + /usr/share/common-licenses or . diff --git a/packaging/focal/rules b/packaging/focal/rules new file mode 100755 index 0000000..e73eae0 --- /dev/null +++ b/packaging/focal/rules @@ -0,0 +1,23 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + +%: + dh $@ + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) diff --git a/packaging/focal/source/format b/packaging/focal/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/packaging/focal/source/format @@ -0,0 +1 @@ +3.0 (native)