-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate packages for Debian, Fedora, and Arch at release time using CI
- Loading branch information
Showing
3 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |