mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-15 23:46:12 +00:00
62 lines
2.3 KiB
YAML
62 lines
2.3 KiB
YAML
name: CI/CD pipeline
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Fetch repository
|
|
uses: actions/checkout@v6
|
|
- name: Upgrade packages
|
|
run: sudo apt update -y && sudo apt upgrade -y
|
|
- name: Download and install dependencies
|
|
run: sudo apt install -y make golang libgl-dev libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
|
|
- name: Build using make
|
|
run: make PREFIX=/usr SYSCONFDIR=/etc
|
|
- name: Install to root using make
|
|
run: sudo make PREFIX=/usr SYSCONFDIR=/etc install
|
|
- name: Run stormfetch
|
|
run: stormfetch
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && needs.test.result == 'success'
|
|
steps:
|
|
- name: Fetch repository
|
|
uses: actions/checkout@v6
|
|
- name: Check debian changelog version
|
|
run: test $(grep '^stormfetch' debian/changelog | head -n1 | grep -Po '(?<=\().*(?=\))' | cut -d '-' -f1) == ${{ github.ref_name }}
|
|
- name: Upgrade packages
|
|
run: sudo apt update -y && sudo apt upgrade -y
|
|
- name: Download and install dependencies
|
|
run: sudo apt install -y make debhelper golang libgl-dev libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
|
|
- name: Build deb package
|
|
run: dpkg-buildpackage -b
|
|
- name: Read changelog
|
|
id: read_changelog
|
|
run: |
|
|
r=$(cat CHANGELOG.md) # Read CHANGELOG.md
|
|
r="${r//'%'/'%25'}" # Multiline escape sequences for %
|
|
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
|
|
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
|
|
echo "RELEASE_BODY=$r" >> $GITHUB_OUTPUT # Set environment variable
|
|
- name: Upload deb packages release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
release_name: v${{ github.ref_name }}
|
|
file: ../*.deb
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
file_glob: true
|
|
draft: true
|
|
body: |
|
|
${{ steps.read_changelog.outputs.RELEASE_BODY }}
|