Skip to content

Update build.yml

Update build.yml #896

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build-fedora:
name: Build Fedora
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fedora_version: [ '37', '38', '39' ]
container:
image: fedora:${{matrix.fedora_version}}
steps:
- name: Update repositories
if: matrix.fedora_version != '39'
run: dnf update -y
- name: Upgrade packages
#if: matrix.fedora_version != '39'
run: dnf upgrade -y
- name: Install dependencies
run: >
dnf install -y
@development-tools
redhat-lsb-core
which
git
glibc
gcc-c++
rpmdevtools
make
cmake
pkgconfig
glib
man
tar
gettext
openssh
rsync
boost-devel
dbus-devel
protobuf-devel
protobuf-compiler
sqlite-devel
alsa-lib-devel
pulseaudio-libs-devel
libnotify-devel
libicu-devel
qt6-qtbase-devel
qt6-qtbase-private-devel
qt6-qttools-devel
gstreamer1-devel
gstreamer1-plugins-base-devel
taglib-devel
libcdio-devel
libgpod-devel
libmtp-devel
libchromaprint-devel
libebur128-devel
fftw-devel
desktop-file-utils
libappstream-glib
hicolor-icon-theme
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add safe git directory
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON
- name: Create source tarball
working-directory: build
run: ../dist/scripts/maketarball.sh
- name: Create RPM build sources directories
working-directory: build
run: mkdir -p ~/rpmbuild/SOURCES /usr/src/packages/SOURCES
- name: Copy source tarball
working-directory: build
run: cp strawberry-*.tar.xz ~/rpmbuild/SOURCES/
- name: Build RPM
env:
RPM_BUILD_NCPUS: "2"
working-directory: build
run: rpmbuild -ba ../dist/unix/strawberry.spec
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: fedora-${{matrix.fedora_version}}
path: |
/github/home/rpmbuild/SRPMS/*.rpm
/github/home/rpmbuild/RPMS/x86_64/*.rpm
- name: SSH key setup
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci'
uses: shimataro/ssh-key-action@v2
with:
known_hosts: ${{secrets.SSH_KNOWN_HOSTS}}
key: ${{ secrets.SSH_KEY }}
- name: Create server path
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci'
run: ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} mkdir -p ${{secrets.BUILDS_PATH}}/fedora/${{matrix.fedora_version}}
- name: rsync
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci'
run: rsync -e "ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no" -var /github/home/rpmbuild/SRPMS/*.rpm /github/home/rpmbuild/RPMS/x86_64/*.rpm ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{secrets.BUILDS_PATH}}/fedora/${{matrix.fedora_version}}/