Compare commits

..

1 Commits

Author SHA1 Message Date
unkinben a77ce8eb57 feat: updating droneci tasks
continuous-integration/drone/pr Build is failing
- update dnf repo management
- update command to install packages
- add triggers
2024-08-25 13:18:16 +10:00
5 changed files with 33 additions and 79 deletions
+30
View File
@@ -0,0 +1,30 @@
kind: pipeline
type: docker
name: default
trigger:
branch:
- master
steps:
- name: build
image: almalinux:8.10
commands:
# Remove default repos
- rm -rf /etc/yum.repos.d/*.repo
# Add edgecache repos
- echo -e "[epel]\nname=epel repository\nbaseurl=http://edgecache.query.consul/epel/8/Everything/x86_64\ngpgkey=http://edgecache.query.consul/epel/RPM-GPG-KEY-EPEL-8\nenabled=1\ngpgcheck=1" > /etc/yum.repos.d/epel.repo
- echo -e "[baseos]\nname=baseos repository\nbaseurl=http://edgecache.query.consul/almalinux/8.10/BaseOS/x86_64/os\ngpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8\nenabled=1\ngpgcheck=1" > /etc/yum.repos.d/baseos.repo
- echo -e "[appstream]\nname=appstream repository\nbaseurl=http://edgecache.query.consul/almalinux/8.10/AppStream/x86_64/os\ngpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8\nenabled=1\ngpgcheck=1" > /etc/yum.repos.d/appstream.repo
- echo -e "[powertools]\nname=powertools repository\nbaseurl=http://edgecache.query.consul/almalinux/8.10/PowerTools/x86_64/os\ngpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8\nenabled=1\ngpgcheck=1" > /etc/yum.repos.d/powertools.repo
# Clean and update repository cache
- dnf clean all
- dnf makecache
# Install the required packages using custom repositories
- dnf install -y golang gcc gcc-c++ make git sqlite-devel taglib-devel ffmpeg mpv rpmdevtools wget systemd sqlite taglib
# Run the `make` command
- make
-35
View File
@@ -1,35 +0,0 @@
name: Build RPMs
on:
pull_request:
jobs:
build:
name: Build on AlmaLinux 8
runs-on: almalinux-8
container:
image: git.query.consul/unkin/almalinux8:latest
steps:
- name: Install nodejs:20
run: |
dnf module enable -y nodejs:20
dnf install -y nodejs
- name: Checkout code
uses: actions/checkout@v3
- name: Install RPMFusion
run: |
dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm
- name: Install required packages
run: |
dnf install -y golang gcc gcc-c++ make git sqlite-devel taglib-devel ffmpeg mpv rpmdevtools wget systemd sqlite taglib
- name: Build project
run: make build
- name: Find built packages
run: |
find /workspace | grep -E \.rpm$
-41
View File
@@ -1,41 +0,0 @@
name: Build and Upload RPMs
on:
push:
branches:
- master
jobs:
build:
name: Build on AlmaLinux 8
runs-on: almalinux-8
container:
image: git.query.consul/unkin/almalinux8:latest
steps:
- name: Install nodejs:20
run: |
dnf module enable -y nodejs:20
dnf install -y nodejs
- name: Checkout code
uses: actions/checkout@v3
- name: Install RPMFusion
run: |
dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm
- name: Install required packages
run: |
dnf install -y golang gcc gcc-c++ make git sqlite-devel taglib-devel ffmpeg mpv rpmdevtools wget systemd sqlite taglib
- name: Build project
run: make build
- name: Upload RPMs to Gitea
env:
DRONECI_PASSWORD: ${{ secrets.DRONECI_PASSWORD }}
run: |
for rpm in /workspace/src/rpmbuild/RPMS/*/*.rpm; do
curl --user droneci:${{ secrets.DRONECI_PASSWORD }} --upload-file $rpm https://git.query.consul/api/packages/unkin/rpm/almalinux/el8/upload
done
+2 -2
View File
@@ -1,6 +1,6 @@
.PHONY: all prep download build clean
RPMBUILD := /workspace/src/rpmbuild
RPMBUILD := $(HOME)/rpmbuild
SOURCES := $(RPMBUILD)/SOURCES
SPECS := $(RPMBUILD)/SPECS
SPECFILE := gonic.spec
@@ -23,7 +23,7 @@ download: prep
build: $(SPECFILE) download
@echo "Building RPM..."
@rpmbuild -ba --define "_topdir $(RPMBUILD)" $(SPECFILE)
@rpmbuild -ba $(SPECFILE)
@echo "RPM built."
clean:
+1 -1
View File
@@ -15,7 +15,7 @@ Requires: golang, git, sqlite, taglib, ffmpeg, mpv, systemd
%description
Gonic is a lightweight music streaming server written in Go.
%global debug_package %{nil}
%global debug_package %{nil}
%prep
%autosetup -n %{name}-%{version}