Skip to content

Commit

Permalink
feat(ci): modified action to build rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeCyp committed Sep 20, 2024
1 parent 04325d8 commit d7ebe81
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 24 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- ci/create-rpm-package
pull_request:
env:
os: RHEL
Expand Down Expand Up @@ -41,17 +42,23 @@ jobs:
name: ${{ needs.parsing.outputs.compname }}
compvers: ${{ needs.parsing.outputs.compvers }}
arch: ${{ needs.parsing.outputs.comparch }}

container:
image: fedora:40
steps:
- uses: actions/checkout@v4

- name: Install RPM
run: sudo apt update && sudo apt upgrade -y && sudo apt install rpm

run: |
sudo dnf install rust cargo -y -v
export PATH=$PATH:$HOME/.cargo/bin/
sudo dnf install rpm-build rpmdevtools -y -v
sudo dnf install cargo-rpm-macros -y -v
cargo install cargo-lock2rpmprovides
- name: Setup for alumet
run: |
mkdir -p alumet
- name: Install alumet
- name: Checkout alumet
uses: actions/checkout@v4
with:
repository: alumet-dev/alumet
Expand All @@ -63,8 +70,31 @@ jobs:
env:
build_dir: "$(pwd)/build"
run: |
echo $(pwd)
ls -al
mkdir -p ${{ env.build_dir }}/SOURCES
tar --exclude=".[^/]*" --exclude="./build" --transform 's|.|alumet|' -zcvf ${{ env.build_dir }}/SOURCES/alumet.tar.gz .
rpmbuild -ba --define "_topdir ${{ env.build_dir }}" specs/alumet.spec
rpmbuild -ba -vv --define "_topdir ${{ env.build_dir }}" --define "release ${{env.os}}${{env.os_version}}" specs/alumet.spec
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.name }}-${{env.os}}${{env.os_version}}.${{ env.arch }}.rpm
path: ./build/RPMS/${{ env.arch }}/alumet-${{ env.compvers }}-${{env.os}}${{env.os_version}}.${{ env.arch }}.rpm

# publish:
# runs-on: ubuntu-latest
# needs:
# - packaging
# env:
# name: ${{ needs.parsing.outputs.compname }}
# compvers: ${{ needs.parsing.outputs.compvers }}
# arch: ${{ needs.parsing.outputs.comparch }}

# steps:
# - name: Checkout git repository
# uses: actions/checkout@v4

# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: ${{ env.name }}-${{env.os}}${{env.os_version}}.${{ env.arch }}.rpm

33 changes: 16 additions & 17 deletions specs/alumet.spec
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
Name: ALUMET
Name: alumet
Version: 0.5.0
Release: 1%{?dist}
Release: %{release}
Summary: A tool for measuring the energy consumption and performance metrics
License: EUPL
Url: https://github.com/alumet-dev/alumet
Source: %{name}_v%{version}.tar.gz
Source: %{name}.tar.gz
BuildArch: x86_64


# Disable this line if you wish to support all platforms.
# In most situations, you will likely only target tier1 arches for user facing components.

%description
Customizable and efficient tool for measuring the energy consumption and performance metrics of software on HPC, Cloud and Edge devices.
Expand All @@ -19,21 +16,23 @@ Customizable and efficient tool for measuring the energy consumption and perform


%build
%{cargo_build}

cd alumet/app-agent
CARGO_TARGET_DIR=%{_builddir} cargo build --release

%install
pwd
ls -al
cd app-agent
%{cargo_install}
pwd
ls -al
mkdir -p %{buildroot}%{_bindir}
ls -al %{_builddir}/release/
ls -al %{_builddir}/release/build/
ls -al %{_builddir}/release/build/build/
ls -al %{_builddir}/release/incremental
ls -al %{buildroot}%{_bindir}
install -m 0755 %{_builddir}/release/alumet-agent %{buildroot}%{_bindir}/alumet-agent


%files
# %license LICENSE
%{_bindir}/alumet-agent


%clean
ù{cargo}
%changelog
* Wed Sep 18 2024 Cyprien [email protected] - 0.0.1
- Initial package

0 comments on commit d7ebe81

Please sign in to comment.