Skip to content

Commit

Permalink
Release CI (#13)
Browse files Browse the repository at this point in the history
Automate packages for Debian, Fedora, and Arch at release time using CI
  • Loading branch information
aaruni96 authored Jun 17, 2024
1 parent c9cc4e5 commit 7a103be
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run the Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
Create_Packages:
name: "Create Packages"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Arch PKGBUILD
run: |
mkdir -pv /tmp/RELEASE
cp -v pkg/arch/PKGBUILD /tmp/RELEASE/
- name: Install DEB deps
run: |
sudo apt update
sudo apt install devscripts libcairo2-dev git gcc python3 python3-dev libgirepository1.0-dev libostree-dev fuse-overlayfs python3-venv libcap-dev autoconf python3-gi python3-tomli debhelper-compat
- name: Run DEB pkg script
run: |
pwd
ls
ls pkg
ls pkg/debian
bash pkg/debian/build-debian.sh
mkdir -pv /tmp/RELEASE
mv -v /tmp/maps-build-temp/maps*.deb /tmp/RELEASE/
- name: Install RPM deps
run: |
sudo apt install rpm
- name: Run RPM pkg script
run: |
pwd
ls
ls pkg
ls pkg/rpm
bash pkg/rpm/build-rpm.sh
- name: Release
uses: softprops/action-gh-release@v1
with:
files: /tmp/RELEASE/*
44 changes: 44 additions & 0 deletions pkg/rpm/build-rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

set -e

MAPSDIR=$(pwd)

echo "Setting up rpmbuild dir"
mkdir -pv $HOME/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}

echo "cd to rpmbuild"
cd "$HOME/rpmbuild"
ls

cp -rv $MAPSDIR ./
ls

VERSION=$(cat maps/Readme.md | grep -i 'version' | head -n 1 | sed 's/^.*version-//' | sed 's/-.*//').0.1

echo "VERSION is $VERSION"

mv maps maps-$VERSION

#cd "$HOME/rpmbuild/maps-$VERSION"

# figure out changelogs later
#git log --format="* %ad %an - %s%b%n" $(git rev-list --tags --max-count=1)..HEAD >> pkg/rpm/maps.spec

#cd "$HOME/rpmbuild"

tar -czf maps-$VERSION.tar.gz maps-$VERSION

mv maps-$VERSION.tar.gz SOURCES

echo "trying to move SPECfile to right place"
echo "step1 : list specfile"
ls "maps-$VERSION"
ls "maps-$VERSION/pkg"
ls "maps-$VERSION/pkg/rpm"
cp -v maps-$VERSION/pkg/rpm/maps.spec SPECS/maps.spec

rpmbuild -bb SPECS/maps.spec

mkdir -pv /tmp/RELEASE/
cp -v RPMS/noarch/maps*.rpm /tmp/RELEASE/
34 changes: 34 additions & 0 deletions pkg/rpm/maps.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Name: maps
Version: 0.1.0.1
Release: 1%{?dist}
Summary: Mathematical Packaging System
BuildArch: noarch

License: GPL3
URL: https://github.com/mardi4NFDI/maps
Source0: %{name}-%{version}.tar.gz

Requires: git cairo-devel gcc python3-devel gobject-introspection-devel ostree-devel fuse-overlayfs libcap-devel autoconf cairo-gobject-devel bash-completion python-tomli

%description
MaPS helps mathematicians create and publish software runtimes, as well as deploy and run software inside published runtimes


%prep
%setup -q


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir} $RPM_BUILD_ROOT/%{_datadir}/bash-completion/completions
cp src/%{name} $RPM_BUILD_ROOT/%{_bindir}
cp src/completion.bash $RPM_BUILD_ROOT/%{_datadir}/bash-completion/completions/%{name}


%files
%{_bindir}/%{name}
%{_datadir}/bash-completion/completions/%{name}



%changelog

0 comments on commit 7a103be

Please sign in to comment.