Add a Github Action to build and package fastfetch for Debian. (#127)

* Create a build.yml file

* add debian packaging

untested

* Copy & Paste is hard

* Fix typo, libRpm -> librpm

* Change working-dir

* Try again. Maybe now it will find the deb package

* Add more dependencies

* This should be it, hopefully

* Fix installed packages

* Change the name of the auto-created releases

* Document GH action

* Remove unnecessary packages. 

Apparently brute-forcing dependencies until the build is successful is not a good strategy.

* Move building the packaging into a seperate github action.

* Remove packaging from test Action
This commit is contained in:
xzvf
2022-02-08 19:15:28 +01:00
committed by GitHub
parent cc43ed2351
commit 87e410e0fc
2 changed files with 85 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
name: CMake
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install dependencies, so that CMake enables all modules
- name: install packages
run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libxfconf-0-dev librpm-dev libzstd-dev
# Kick off the debian packaging
- name: Create deb package
working-directory: ${{github.workspace}}/packaging/deb
run: sh ./create-deb-pkg.sh
# Create a release draft with the fastfetch.deb file
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Debian package for ${{ github.sha }}
draft: true
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{github.workspace}}/packaging/deb/fastfetch.deb
asset_name: fastfetch.deb
asset_content_type: application/vnd.debian.binary-package
+38
View File
@@ -0,0 +1,38 @@
name: CMake
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install dependencies, so that CMake enables all modules
- name: install packages
run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libxfconf-0-dev librpm-dev libzstd-dev
# Just build fastfetch normally. This is to check for compilation/program errors.
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Run fastfetch
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ./fastfetch