Skip to content

v0.2.10: headline holds for 5 min per state, animations vary by sensor #48

v0.2.10: headline holds for 5 min per state, animations vary by sensor

v0.2.10: headline holds for 5 min per state, animations vary by sensor #48

Workflow file for this run

name: ci
# Unified CI shape across ra-yavuz/* packaged repos.
#
# lint project-specific lint (cargo fmt+clippy+shellcheck here)
# build-deb produces dist/*.deb (+ dist/*.plasmoid where applicable),
# uploaded as artifact "dist"
# release tag-only. Downloads dist, creates GitHub Release with all
# artifacts, then dispatches each .deb to ra-yavuz/apt so the
# apt repository auto-publishes it.
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: |
rustup update stable
rustup component add clippy rustfmt
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }}
- name: Install build deps
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends pkg-config libssl-dev libdbus-1-dev shellcheck
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: shellcheck
run: shellcheck scripts/*.sh debian/postinst debian/postrm docs/get.sh
build-deb:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
- name: Install build deps
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends pkg-config libssl-dev libdbus-1-dev dpkg-dev fakeroot zip
- name: Build .deb
run: bash scripts/build-deb.sh
- name: Build plasmoid bundle
run: bash scripts/build-plasmoid.sh
- name: Inspect .deb
run: dpkg-deb -I dist/*.deb && dpkg-deb -c dist/*.deb | head -40
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
release:
runs-on: ubuntu-latest
needs: build-deb
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/*.deb
dist/*.plasmoid
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify ra-yavuz/apt to auto-publish
if: env.APT_DISPATCH_TOKEN != ''
env:
APT_DISPATCH_TOKEN: ${{ secrets.APT_DISPATCH_TOKEN }}
run: |
set -euo pipefail
tag="${GITHUB_REF#refs/tags/}"
for deb in dist/*.deb; do
[ -f "$deb" ] || continue
arch=$(dpkg-deb -f "$deb" Architecture)
url="https://github.com/${{ github.repository }}/releases/download/${tag}/$(basename "$deb")"
echo "Dispatching $deb -> ra-yavuz/apt"
curl -fsSL -X POST \
-H "Authorization: token $APT_DISPATCH_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/ra-yavuz/apt/dispatches" \
-d "{\"event_type\":\"package-published\",\"client_payload\":{\"repo\":\"${{ github.repository }}\",\"tag\":\"${tag}\",\"arch\":\"${arch}\",\"deb_url\":\"${url}\"}}"
done