Compare commits

...

17 Commits

Author SHA1 Message Date
Linus Dierheimer 30365e8997 Release prebuild binaries as tar.gz and zip 2022-03-25 12:16:06 +01:00
Linus Dierheimer 5b66938bf4 Release with rpm package too 2022-03-25 12:09:48 +01:00
Linus Dierheimer 80c5600a7b Use cmake to build packages 2022-03-25 11:57:58 +01:00
Linus Dierheimer 65ce2eafed Hopefully finally fix github actions 2022-03-24 22:26:44 +01:00
Linus Dierheimer d840c7a12d Use workflow instead of action 2022-03-24 22:15:46 +01:00
Linus Dierheimer 634e27bc42 Try to give github actions the right permissions 2022-03-24 22:02:39 +01:00
Linus Dierheimer cc18315e84 Fix check action 2022-03-24 21:59:15 +01:00
Linus Dierheimer 83e2787b24 Use reusable action for check 2022-03-24 21:57:53 +01:00
Linus Dierheimer ef5a9384da Try to fix github actions again 2022-03-24 21:49:39 +01:00
Linus Dierheimer 2d7e6c37ff Try to fix github actions 2022-03-24 21:43:27 +01:00
Linus Dierheimer 92e8f23261 Refactored github actions again 2022-03-24 21:38:56 +01:00
Linus Dierheimer e09f1d3647 Refactored github actions 2022-03-24 21:32:45 +01:00
Linus Dierheimer 6f01e33955 Clear URL from unsucessfull media detection too 2022-03-24 19:06:20 +01:00
Linus Dierheimer 4b813cdf59 Automatic track commits between versions 2022-03-24 18:56:44 +01:00
Linus Dierheimer 942c583c89 Media: Don't show website urls 2022-03-23 21:41:52 +01:00
Linus Dierheimer 24a48c1fc0 Dont show lyric information in song title 2022-03-23 16:07:47 +01:00
Linus Dierheimer e2e95732e8 Don't remove dirty / clean from song title 2022-03-23 15:58:30 +01:00
12 changed files with 124 additions and 127 deletions
+37
View File
@@ -0,0 +1,37 @@
name: manage pull requests
on: pull_request
jobs:
check:
name: manage pull request
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: install required packages
run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libxfconf-0-dev rpm librpm-dev libzstd-dev
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
- name: configure project
run: cmake -DBUILD_TESTS=On .
- name: build project
run: cmake --build . -j$(nproc) --target package
- name: run fastfetch
run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true
- name: run flashfetch
run: ./flashfetch
- name: run tests
run: ctest
- name: perform CodeQL analysis
uses: github/codeql-action/analyze@v1
+27 -68
View File
@@ -1,101 +1,60 @@
name: Manage pushes and pull requests
name: manage pushes
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Release
jobs:
check:
name: Build, Run and Analyze fastfetch
manage:
name: manage push
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: checkout repository
uses: actions/checkout@v2
- name: Update and 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 libdbus-1-dev libxfconf-0-dev librpm-dev libzstd-dev
- name: install required packages
run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libxfconf-0-dev rpm librpm-dev libzstd-dev
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} .
- name: configure project
# We reuse the build binary only for the releases.
# We set tweak version to off, because it is wrong, as git tag will happen after this step. Releases don't have a tweak, so this is ok.
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
- name: Build
run: cmake --build . -j$(nproc)
- name: build project
run: cmake --build . -j$(nproc) --target package
- name: Run fastfetch
run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true
- name: run fastfetch
run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true
- name: Run flashfetch
run: ./flashfetch
- name: run flashfetch
run: ./flashfetch
- name: Run tests
run: ctest
- name: run tests
run: ctest
- name: Build deb package
run: sh packaging/deb/create.sh .
- name: perform CodeQL analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Create tarball
if: github.event_name == 'push'
run: tar -cvf fastfetch.tar ./fastfetch -C packaging/deb ./fastfetch.deb
- name: Upload tarball
if: github.event_name == 'push'
uses: actions/upload-artifact@v3
with:
name: fastfetch.tar
path: ./fastfetch.tar
deploy:
name: Create GitHub release
runs-on: ubuntu-latest
needs: check
if: github.event_name == 'push'
permissions:
contents: write
steps:
- name: Download tarball
uses: actions/download-artifact@v3
with:
name: fastfetch.tar
path: ./fastfetch.tar
- name: Extract tarball
run: tar --overwrite -xvf ./fastfetch.tar/fastfetch.tar
- name: Get fastfetch version
- name: get fastfetch version
id: get_version_fastfetch
run: echo "::set-output name=release::$(./fastfetch --version-raw)"
- name: Get latest release version
- name: get latest release version
id: get_version_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
- name: Push release
- name: create release
if: steps.get_version_fastfetch.outputs.release != steps.get_version_release.outputs.release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.get_version_fastfetch.outputs.release }}
commit: ${{ github.sha }}
artifacts: ./fastfetch,./fastfetch.deb
artifacts: ./fastfetch-*.*
-3
View File
@@ -1,3 +0,0 @@
[submodule "packaging/aur"]
path = packaging/aur
url = https://aur.archlinux.org/fastfetch-git.git
+52 -9
View File
@@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.1.0) # Threads::Threads
project(fastfetch
VERSION 1.2.0
VERSION 1.2.2
LANGUAGES C
)
#e.g. +1
#This allows to track builds between versions, without GitHub creating a new release
set(PROJECT_VERSION_EXTRA "")
# This is set to off by github actions for release builds
OPTION(SET_TWEAK "Add tweak to project version" ON)
include(GNUInstallDirs)
# Also create test executables
OPTION(BUILD_TESTS "Build tests" OFF)
OPTION(ENABLE_LIBPCI "Enable libpci" ON)
OPTION(ENABLE_VULKAN "Enable vulkan" ON)
@@ -23,7 +23,17 @@ OPTION(ENABLE_DCONF "Enable dconf" ON)
OPTION(ENABLE_DBUS "Enable dbus-1" ON)
OPTION(ENABLE_XFCONF "Enable libxfconf-0" ON)
OPTION(ENABLE_RPM "Enable rpm" ON)
OPTION(BUILD_TESTS "Build tests" ON)
# Track commits between version bumps for output in --version
if (SET_TWEAK AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git describe --tags
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE PROJECT_VERSION_TWEAK
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX MATCH "-[0-9]+" PROJECT_VERSION_TWEAK "${PROJECT_VERSION_TWEAK}")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
@@ -55,7 +65,7 @@ find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
# Init CMake targets.
# Init CMake targets
add_library(libfastfetch STATIC
src/util/FFstrbuf.c
@@ -267,7 +277,7 @@ target_link_libraries(flashfetch
PRIVATE libfastfetch
)
# Testing.
# Testing
if (BUILD_TESTS)
add_executable(fastfetch-test-performance
@@ -288,7 +298,9 @@ if (BUILD_TESTS)
add_test(NAME test-strbuf COMMAND fastfetch-test-strbuf)
endif()
# Installation.
# Installation
include(GNUInstallDirs)
install(
TARGETS fastfetch
@@ -310,3 +322,34 @@ install(
FILES ./LICENSE
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/licenses/${CMAKE_PROJECT_NAME}
)
# Packaging
set(CPACK_GENERATOR "DEB;RPM;TGZ;ZIP")
set(CPACK_PACKAGE_CONTACT "Linus Dierheimer <Linus@Dierheimer.de>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Neofetch clone written in C")
set(CPACK_PACKAGE_DESCRIPTION "
fastfetch is a neofetch-like tool for fetching system information and displaying them in a pretty way.
It is written in c to achieve much better performance.
")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/LinusDierheimer")
set(CPACK_DEBIAN_PACKAGE_SECTION, "utils")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "
libpci3
libvulkan1
libwayland-client0
libxcb-randr0
xcb
libxrandr2
libx11-6
libdconf1
libglib2.0-0
libdbus-1-3
libxfconf-0-3
")
include(CPack)
+1 -1
View File
@@ -86,7 +86,7 @@ If pkg-config fails to find the headers for a library listed in [dependencies](#
* [AUR](https://aur.archlinux.org/packages/fastfetch-git/): Packaged by me. Will install the fastfetch binary, bash completion and the presets. Git version
* [Manjaro Repositories](https://gitlab.manjaro.org/packages/community/fastfetch): Packaged by a manjaro maintainer. Usually a bit outdated.
* [Gentoo (Guru)](https://github.com/gentoo/guru/tree/master/app-misc/fastfetch): Packed by some other guy. May be out of date some times.
* DEB: Run [`packaging/deb/create.sh`](packaging/deb/create.sh) from the root directory. You can give a custom build directory as an argument.
* DEB / RPM: Run `cmake -B build && cmake --build build --target package` to build the packages in build.
* Manually:
* Build: Follow the [build instructions](#building).
* Install: `sudo cmake --install build --prefix /usr/local`
Submodule packaging/aur deleted from 7ac9c5d132
-13
View File
@@ -1,13 +0,0 @@
Package: fastfetch
Version: <VERSION>
Section: utils
Priority: extra
Architecture: amd64
Maintainer: Linus@Dierheimer.de
Homepage: https://github.com/LinusDierheimer/fastfetch
Installed-Size: 410K
Description: A fast alternative to neofetch
fastfetch is a neofetch-like tool for fetching system information and
displaying them in a pretty way. It is written in c to achieve much better
performance, in return only Linux and Android are supported. It also uses
mechanisms like multithreading and caching to finish as fast as possible.
-28
View File
@@ -1,28 +0,0 @@
#!/bin/sh
# This script is intended to be run from the root of the repository.
# If you don't want to use build/ as build directoy, or already build the elsewere, you can give the build directoy as argument.
BUILD_DIR="${1:-build}"
ROOT_DIR="${2:-.}"
PACKAGE_DIR="${BUILD_DIR}/packaging/deb/fastfetch"
# Create missing files
mkdir -p "${BUILD_DIR}" || exit 1
if [ ! -f "${BUILD_DIR}/cmake_install.cmake" ]; then
cmake -S "${ROOT_DIR}" -B "${BUILD_DIR}" || exit 2
rm -f "${BUILD_DIR}/fastfetch" || exit 3 # Always rebuild the project if we reconfigured it
fi
if [ ! -f "${BUILD_DIR}/fastfetch" ]; then
cmake --build "${BUILD_DIR}" || exit 4
fi
# Populate the files
cmake --install "${BUILD_DIR}" --prefix "${PACKAGE_DIR}/usr" || exit 5
mkdir -p "${PACKAGE_DIR}/DEBIAN" || exit 6
sed "s/<VERSION>/$("${BUILD_DIR}/fastfetch" --version-raw)/g" "${ROOT_DIR}/packaging/deb/control-template" > "${PACKAGE_DIR}/DEBIAN/control" || exit 7
# Create the package
dpkg-deb --build "${PACKAGE_DIR}" || exit 8
+1
View File
@@ -208,6 +208,7 @@ static bool getBusProperties(const char* busName, FFMediaResult* result, DBusDat
{
ffStrbufClear(&result->artist);
ffStrbufClear(&result->album);
ffStrbufClear(&result->url);
return false;
}
+1 -1
View File
@@ -617,7 +617,7 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
}
else if(strcasecmp(key, "-v") == 0 || strcasecmp(key, "--version") == 0)
{
puts("fastfetch "FASTFETCH_PROJECT_VERSION""FASTFETCH_PROJECT_VERSION_EXTRA);
puts("fastfetch "FASTFETCH_PROJECT_VERSION""FASTFETCH_PROJECT_VERSION_TWEAK);
exit(0);
}
else if(strcasecmp(key, "--version-raw") == 0)
+1 -1
View File
@@ -4,7 +4,7 @@
#define FASTFETCH_PROJECT_NAME "@PROJECT_NAME@"
#define FASTFETCH_PROJECT_VERSION "@PROJECT_VERSION@"
#define FASTFETCH_PROJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define FASTFETCH_PROJECT_VERSION_EXTRA "@PROJECT_VERSION_EXTRA@"
#define FASTFETCH_PROJECT_VERSION_TWEAK "@PROJECT_VERSION_TWEAK@"
#define FASTFETCH_DATATEXT_STRUCTURE "@DATATEXT_STRUCTURE@"
#define FASTFETCH_DATATEXT_CONFIG "@DATATEXT_CONFIG@" //Requires FASTFETCH_PROJECT_VERSION and FASTFETCH_DATATEXT_STRUCTURE to be set
+4 -2
View File
@@ -58,7 +58,8 @@ void ffPrintSong(FFinstance* instance)
"| Official Music Video", "| Official Video", "| Music Video",
"[Official Audio]", "[Audio]", "(Audio)", "| Official Audio", "| Audio", "| OFFICIAL AUDIO",
"(Lyric Video)", "(Official Lyric Video)", "(Lyrics)",
"(dirty version)", "(dirty)", "(Clean)", "(Clean Version)",
"[Lyric Video]", "[Official Lyric Video]", "[Lyrics]",
"| Lyric Video", "| Official Lyric Video", "| Lyrics",
};
ffStrbufRemoveStringsA(&songPretty, sizeof(removeStrings) / sizeof(removeStrings[0]), removeStrings);
ffStrbufTrimRight(&songPretty, ' ');
@@ -86,7 +87,8 @@ void ffPrintSong(FFinstance* instance)
fputs(" - ", stdout);
}
if(media->album.length > 0)
//Some sites (e.g. reddit) expose their url as album. We don't want to show that
if(media->album.length > 0 && !ffStrbufStartsWithIgnCaseS(&media->album, "http"))
{
ffStrbufWriteTo(&media->album, stdout);
fputs(" - ", stdout);