Skip to content

Commit

Permalink
updated for build workflow v2
Browse files Browse the repository at this point in the history
  • Loading branch information
bkelly16 committed Feb 6, 2025
1 parent aae5fe6 commit f8ee700
Show file tree
Hide file tree
Showing 15 changed files with 214 additions and 73 deletions.
101 changes: 72 additions & 29 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,82 @@ on:
push:
branches:
- main
- build
tags:
- 'v*.*.*'
jobs:
main:
runs-on: self-hosted
prebuild:
runs-on: buildinator-group
outputs:
manifest: ${{ steps.prebuild.outputs.manifest }}
matrix: ${{ steps.prebuild.outputs.matrix }}
uuid: ${{ steps.prebuild.outputs.uuid }}
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
uses: actions/checkout@v3

- id: prebuild
name: Prebuild flow
uses: 45drives/actions/prebuild-flow@main
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
directory: ${{ github.workspace }}

build:
needs: prebuild
runs-on: buildinator-group
strategy:
matrix:
build: ${{ fromJSON(needs.prebuild.outputs.matrix).include }}
steps:
- name: Build package
uses: 45drives/actions/build-package@main
with:
manifest: ${{ needs.prebuild.outputs.manifest }}
build: ${{ toJSON(matrix.build) }}
uuid: ${{ needs.prebuild.outputs.uuid }}

sign:
needs:
- prebuild
- build
runs-on: buildinator-group
steps:
- name: Run sign playbook
uses: 45drives/actions/ansible-playbook@main
with:
playbook: /root/git/auto-packaging/actions/ansible/sign.yml
directory: ${{ github.workspace }}/packaging
group_vars_directory: ${{ github.workspace }}/packaging/group_vars/
inventory: |
[ci]
localhost
become: true
host_key_checking: true
extra_vars: sign_key_name=prod

update_repositories:
needs:
- prebuild
- build
- sign
runs-on: buildinator-group
steps:
- id: push_local
name: Push packages into local repository
uses: 45drives/actions/update-repo@main
with:
directory: ${{ github.workspace }}

sync_repositories:
needs:
- prebuild
- build
- sign
- update_repositories
runs-on: buildinator-group
steps:
- id: push_remote
name: Sync local repository with remote repository
if: startsWith(github.ref, 'refs/tags/')
run: publish-repo
uses: 45drives/actions/sync-repo@main
with:
directory: ${{ github.workspace }}
47 changes: 28 additions & 19 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,55 @@
{
"__version": "45D-R1",
"schema_version": "45D_AP_V2.0",
"name": "samba-ansible",
"title": "Samba-ansible",
"prerelease": false,
"description": "Deploy samba,ctdb and domain joins w. anisble ",
"version": "1.1.5",
"buildVersion": "1",
"build_number": "1",
"stable": true,
"author": "Brett Kelly <[email protected]>",
"url": "https://github.com/45Drives/samba-ansible",
"category": "utils",
"priority": "optional",
"git_url": "https://github.com/45Drives/samba-ansible",
"licence": "GPL-3.0+",
"architecture": {
"deb": "all",
"el": "noarch"
},
"description": {
"long": "Deploy samba,ctdb and domain joins w. anisble ",
"short": "Deploy samba,ctdb and domain joins w. anisble "
},
"defaults": {
"urgency": "medium"
},
"dependencies": {
"deb": [
"ubuntu_common": [
"ansible"
],
"el": [
"rocky_common": [
"ansible"
]
},
"releases": [
"builds": [
{
"group": "ubuntu",
"os_name": "ubuntu-focal",
"image": "ci.cr.45d.io/ci/simple/ubuntu-focal:1"
},
{
"image": "ubuntu-focal-builder",
"codeName": "focal",
"type": "deb"
"group": "ubuntu",
"os_name": "ubuntu-jammy",
"image": "ci.cr.45d.io/ci/simple/ubuntu-jammy:1"
},
{
"image": "rocky-el8-builder",
"codeName": "el8",
"type": "el"
"group": "rocky",
"os_name": "rocky-el8",
"image": "ci.cr.45d.io/ci/simple/rocky-el8:1"
},
{
"group": "rocky",
"os_name": "rocky-el9",
"image": "ci.cr.45d.io/ci/simple/rocky-el9:1"
}
],
"repos": [
"community",
"enterprise"
],
"changelog": {
"urgency": "medium",
"version": "1.1.5",
Expand Down
12 changes: 0 additions & 12 deletions packaging/focal/control

This file was deleted.

20 changes: 10 additions & 10 deletions packaging/el8/main.spec → packaging/rocky-el8/main.spec.j2
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Name: ::package_name::
Version: ::package_version::
Release: ::package_build_version::%{?dist}
Summary: ::package_description_short::
License: ::package_licence::
URL: ::package_url::
Name: {{ name }}
Version: {{ version }}
Release: {{ build_number }}%{?dist}
Summary: {{ description }}
License: {{ license }}
URL: {{ git_url }}
Source0: %{name}-%{version}.tar.gz
BuildArch: ::package_architecture_el::
Requires: ::package_dependencies_el::
BuildArch: {{ architecture.rocky }}
Requires: {{ dependencies.rocky_common | join(',') }}

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description
::package_title::
::package_description_long::
{{ title }}
{{ description }}

%prep
%setup -q
Expand Down
28 changes: 28 additions & 0 deletions packaging/rocky-el9/main.spec.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Name: {{ name }}
Version: {{ version }}
Release: {{ build_number }}%{?dist}
Summary: {{ description }}
License: {{ license }}
URL: {{ git_url }}
Source0: %{name}-%{version}.tar.gz
BuildArch: {{ architecture.rocky }}
Requires: {{ dependencies.rocky_common | join(',') }}

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description
{{ title }}
{{ description }}

%prep
%setup -q

%build

%install
make DESTDIR=%{buildroot} install

%files
/usr/share/samba-ansible/*

%changelog
File renamed without changes.
13 changes: 13 additions & 0 deletions packaging/ubuntu-focal/control.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: {{ name }}
Section: utils
Priority: optional
Maintainer: {{ author }}
Build-Depends: debhelper-compat (= 12)
Standards-Version: 4.4.1
Homepage: {{ git_url }}
Vcs-Git: {{ git_url }}

Package: {{ name }}
Architecture: {{ architecture.ubuntu }}
Depends: {{ dependencies.ubuntu_common | join(',') }}
Description: {{ description }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ::package_name::
Upstream-Contact: ::package_author::
Source: ::package_url::
Upstream-Name: "{{ name }}"
Upstream-Contact: "{{ author }}"
Source: "{{ git_url }}"

Files: *
Copyright: 2021 Your Name <email@45drives.com>
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
13 changes: 13 additions & 0 deletions packaging/ubuntu-jammy/control.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: {{ name }}
Section: utils
Priority: optional
Maintainer: {{ author }}
Build-Depends: debhelper-compat (= 12)
Standards-Version: 4.4.1
Homepage: {{ git_url }}
Vcs-Git: {{ git_url }}

Package: {{ name }}
Architecture: {{ architecture.ubuntu }}
Depends: {{ dependencies.ubuntu_common | join(',') }}
Description: {{ description }}
23 changes: 23 additions & 0 deletions packaging/ubuntu-jammy/copyright.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: "{{ name }}"
Upstream-Contact: "{{ author }}"
Source: "{{ git_url }}"

Files: *
Copyright: 2021 Your Name <email@45drives.com>
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 <http://www.gnu.org/licenses/>.
23 changes: 23 additions & 0 deletions packaging/ubuntu-jammy/rules
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions packaging/ubuntu-jammy/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)

0 comments on commit f8ee700

Please sign in to comment.