Skip to content

Commit

Permalink
move srpm packaging to separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
pesader committed Aug 9, 2023
1 parent 5fdfee9 commit ee136f0
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,44 @@ jobs:
generate_release_notes: true
files: ${{ env.RPM_PACKAGE_PATH }}

build_srpm:
runs-on: ubuntu-latest
needs: create_tarball
container: fedora:39

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.PACKAGE_VERSION }}
fetch-depth: 0

- name: Install RPM packaging tools
run: |
dnf install -y rpmdevtools rpmlint
- name: Setup RPM directory structure
run: |
rpmdev-setuptree
- name: Download toolenv tarball
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}-${{ env.PACKAGE_VERSION }}.tar.gz

- name: Move tarball to SOURCES directory
run: |
mv "${{ env.PACKAGE_NAME }}-${{ env.PACKAGE_VERSION }}.tar.gz" $(rpm --eval '%{_sourcedir}')
- name: Move spec file to SPECS directory
run: |
mv rpm/toolenv.spec $(rpm --eval '%{_specdir}')
- name: Build the SRPM package
if: ${{ matrix.fedora-version }} == 39
run: |
rpmbuild -bs "$(rpm --eval '%{_specdir}')/toolenv.spec"
- name: Rename the SRPM package
if: ${{ matrix.fedora-version }} == 39
run: |
mv $(rpm --eval '%{_srcrpmdir}')/${{ env.PACKAGE_NAME }}-${{ env.PACKAGE_VERSION }}-1.fc${{ matrix.fedora-version }}.src.rpm $(rpm --eval '%{_srcrpmdir}')/${{ env.PACKAGE_NAME }}-${{ env.PACKAGE_VERSION }}-1.src.rpm
Expand All @@ -111,14 +142,12 @@ jobs:
echo "SRPM_PACKAGE_PATH=$(rpm --eval '%{_srcrpmdir}')/${{ env.PACKAGE_NAME }}-${{ env.PACKAGE_VERSION }}-1.src.rpm" >> $GITHUB_ENV
- name: Upload the SRPM package
if: ${{ matrix.fedora-version }} == 39
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}-${{ env.PACKAGE_VERSION }}-1.src.rpm
path: ${{ env.SRPM_PACKAGE_PATH }}

- name: Release the SRPM package
if: ${{ matrix.fedora-version }} == 39
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
Expand Down

0 comments on commit ee136f0

Please sign in to comment.