mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
110 lines
2.8 KiB
YAML
110 lines
2.8 KiB
YAML
name: Manage pushes and pull requests
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
BUILD_TYPE: Release
|
|
|
|
jobs:
|
|
check:
|
|
name: Build, Run and Analyze fastfetch
|
|
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: 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: Initialize CodeQL
|
|
uses: github/codeql-action/init@v1
|
|
with:
|
|
languages: ${{ matrix.language }}
|
|
|
|
- name: Configure
|
|
run: cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} .
|
|
|
|
- name: Build
|
|
run: cmake --build . -j$(nproc)
|
|
|
|
- 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: Build deb package
|
|
run: sh packaging/deb/create.sh .
|
|
|
|
- name: Perform CodeQL Analysis
|
|
uses: github/codeql-action/analyze@v1
|
|
|
|
- name: Upload binary
|
|
if: github.event_name == 'push'
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: fastfetch
|
|
path: ./fastfetch
|
|
|
|
- name: Upload deb package
|
|
if: github.event_name == 'push'
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: fastfetch.deb
|
|
path: ./packaging/deb/fastfetch.deb
|
|
|
|
deploy:
|
|
name: Create GitHub release
|
|
runs-on: ubuntu-latest
|
|
needs: check
|
|
if: github.event_name == 'push'
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Download binary
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: fastfetch
|
|
path: ./fastfetch
|
|
|
|
- name: Download deb package
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: fastfetch.deb
|
|
path: ./fastfetch.deb
|
|
|
|
- name: Get fastfetch version
|
|
id: get_version_fastfetch
|
|
run: echo "::set-output name=release::$(./fastfetch/fastfetch --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
|
|
if: steps.get_version_fastfetch.outputs.release != steps.get_version_release.outputs.release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ steps.get_version_fastfetch.outputs.release }}
|
|
generate_release_notes: true
|
|
files: |
|
|
./fastfetch/fastfetch
|
|
./fastfetch.deb/fastfetch.deb
|