mirror of
https://github.com/ekaaty/ca-certificates-brazil.git
synced 2025-12-06 01:22:38 -03:00
81 lines
2.0 KiB
YAML
81 lines
2.0 KiB
YAML
name: Build RPM Package
|
|
|
|
on:
|
|
push:
|
|
branches: [ workflows ]
|
|
pull_request:
|
|
branches: [ workflows ]
|
|
|
|
jobs:
|
|
build-rpm:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: fedora:latest
|
|
|
|
steps:
|
|
- name: install RPM build tools
|
|
run: |
|
|
dnf -y install \
|
|
cmake \
|
|
gcc \
|
|
gcc-c++ \
|
|
git \
|
|
rpm-build \
|
|
rpmdevtools \
|
|
tar
|
|
|
|
- name: Setup RPM build tree
|
|
run: |
|
|
rpmdev-setuptree
|
|
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Create source tarball
|
|
run: |
|
|
cmake -B build -S .
|
|
cmake --build build --target sdist
|
|
|
|
- name: Set environment variables
|
|
run: |
|
|
echo "PKG_NAME=ca-certificates-brazil" >> $GITHUB_ENV
|
|
echo "PKG_VERSION=$(grep \
|
|
-m1 -iPo '.*CPACK_PACKAGE_VERSION [\"]*\K[\S]*[^(\"\))]' \
|
|
build/CPackConfig.cmake) \
|
|
" >> $GITHUB_ENV
|
|
|
|
- name: Copy SOURCES and SPEC file
|
|
run: |
|
|
cp packaging/pkg.spec.in ~/rpmbuild/SPECS/${PKG_NAME}.spec
|
|
rpmdev-bumpspec -n ${PKG_VERSION} ~/rpmbuild/SPECS/${PKG_NAME}.spec
|
|
cp dist/*.src.tar.gz ~/rpmbuild/SOURCES/
|
|
|
|
- name: Build RPM
|
|
run: |
|
|
dnf -y builddep ~/rpmbuild/SPECS/ca-certificates-brazil.spec
|
|
rpmbuild -ba ~/rpmbuild/SPECS/ca-certificates-brazil.spec
|
|
|
|
- name: Upload built RPMs
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: built-rpms
|
|
path: |
|
|
~/rpmbuild/RPMS/
|
|
~/rpmbuild/SRPMS/
|
|
|
|
- name: Push Git Tag
|
|
run: |
|
|
git config user.name "GitHub Actions"
|
|
git config user.email "github-actions@users.noreply.github.com"
|
|
git tag ${PKG_VERSION}
|
|
git push origin ${PKG_VERSION}
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: github.ref_type == 'tag'
|
|
with:
|
|
draft: true
|
|
generate_release_notes: true
|
|
files: |
|
|
~/rpmbuild/RPMS/**/*.rpm
|