Skip to content

make the build work step 3 #5

make the build work step 3

make the build work step 3 #5

name: Build Linux Packages
on:
schedule:
- cron: '25 23 * * *'
push:
branches: [ "master" ]
# Publish semver tags as releases.
tags: [ '*.*' ]
pull_request:
branches: [ "master" ]
env:
DIST: el8
ARCH: noarch
jobs:
build_tarball:
name: Build source archive
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Grab the versionnr to use in the main script
- name: Grab the VERSION number in upgrade-ux main script
id: version
run: >-
echo "::set-output name=VERSION::$(
grep ^VERSION opt/upgrade-ux/bin/upgrade-ux |
cut -d= -f2
)"
# The build container is gdha/rpmbuild (using RockyLinux 9)
- name: Replace version in RPM spec so correct source is downloaded when building RPM
run: |
cd packaging/Linux
sudo yum install -y ksh
make dist
- name: Upload source archive as artifact
uses: actions/upload-artifact@v4
with:
name: upgrade-ux-${{ steps.version.outputs.VERSION }}.tar.gz
path: upgrade-ux-${{ steps.version.outputs.VERSION }}.tar.gz
build_rpm:
name: Build .rpm package
needs: build_tarball
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Replace version in RPM spec so correct source is downloaded when building RPM
run: |
cd packaging/Linux
make rpm
- name: Run rpmbuild on RPM spec to produce package
id: rpm
uses: gdha/rpmbuild@main
with:
spec_file: upgrade-ux.spec
- name: Upload .rpm package as artifact
uses: actions/upload-artifact@v4
with:
name: upgrade-ux-${{ steps.version.outputs.VERSION }}-1.${{ env.DIST }}.${{ env.ARCH }}.rpm
path: rpmbuild/RPMS/${{ env.ARCH }}/*.rpm
build_deb:
name: Build .deb package
needs: build_rpm
runs-on: ubuntu-latest
steps:
- name: Download .rpm artifact
uses: actions/download-artifact@v4
id: download
with:
name: upgrade-ux-${{ steps.version.outputs.VERSION }}-1.${{ env.DIST }}.${{ env.ARCH }}.rpm
- name: find .
run: find .
- name: Convert .rpm to .deb
run: |
sudo apt install -y alien
sudo alien -k --verbose --to-deb *.rpm
- name: find .
run: find . -exec readlink -f {} \;
- name: Upload .deb package as artifact
uses: actions/upload-artifact@v4
with:
name: upgrade-ux-${{ steps.version.outputs.VERSION }}-1.${{ env.DIST }}.${{ env.ARCH }}.deb
path: upgrade-ux*.deb
release:
name: Create release with all assets
needs: [build_tarball, build_rpm, build_deb]
runs-on: ubuntu-latest
steps:
- name: Download .rpm artifact
uses: actions/download-artifact@v4
- name: find .
run: find .
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
upgrade-ux-${{ steps.version.outputs.VERSION }}.tar.gz/*.tar.gz
upgrade-ux-${{ steps.version.outputs.VERSION }}-1.${{ env.DIST }}.${{ env.ARCH }}.rpm/**/*.rpm
upgrade-ux-${{ steps.version.outputs.VERSION }}-1.${{ env.DIST }}.${{ env.ARCH }}.deb/**/*.deb