Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/actions/buildrpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ RUN zypper patch -y
# Install necessary packages
RUN zypper in -y \
rpm-build rpmdevtools dnf-plugins-core python3 git gcc fdupes \
python311-pip python311-setuptools python311-setuptools_scm python311-wheel \
python312-pip python312-setuptools python312-setuptools_scm python312-wheel \
python313-pip python313-setuptools python313-setuptools_scm python313-wheel
python311-pip python311-setuptools python311-setuptools_scm python311-wheel python311-pytest \
python312-pip python312-setuptools python312-setuptools_scm python312-wheel python312-pytest \
python313-pip python313-setuptools python313-setuptools_scm python313-wheel python313-pytest

WORKDIR /usr/src/packages

# Copy necessary files to build a rpm package
COPY python-bytecode.spec SPECS/
COPY python-bytecode.tar.gz SOURCES/

# Set up the entrypoint script
COPY entrypoint.sh /entrypoint.sh
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/buildrpm/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
cd /usr/src/packages

# $GITHUB_SERVER_URL (https://github.com)
# $GITHUB_REPOSITORY (mrcaique/bytecode)
git clone "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
tar -czf SOURCES/python-bytecode.tar.gz bytecode

# Update release verion on spec file
sed -i -e "s/##RPMVERSION##/$RELEASE_VERSION/" SPECS/python-bytecode.spec

Expand Down
3 changes: 3 additions & 0 deletions .github/actions/buildrpm/python-bytecode.spec
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Python module to generate and modify bytecode
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
%pytest

%files %{python_files}
%doc README.rst
%license COPYING
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/rpmbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ jobs:
- name: Set release version env
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV

- name: Create source archive
run: >
cd ..
&& tar -czf python-bytecode.tar.gz bytecode
&& mv python-bytecode.tar.gz bytecode/.github/actions/buildrpm

- name: Build RPM package
id: rpm
uses: ./.github/actions/buildrpm

- name: Upload RPM as artifact
Expand Down