Skip to content

Update timmo001/workflows digest to 258c64a #180

Update timmo001/workflows digest to 258c64a

Update timmo001/workflows digest to 258c64a #180

Workflow file for this run

---
name: CI
# yamllint disable-line rule:truthy
on:
pull_request:
push:
branches:
- main
workflow_dispatch: {}
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0 # Need full history for version calculation
- name: Set up mise
uses: jdx/mise-action@dad1bfd3df957f44999b559dd69dc1671cb4e9ea # v4.2.1
- name: Typecheck TUI
run: mise run typecheck:tui
- name: Build Go app and TUI
run: |
# Fix git ownership for VCS stamping
git config --global --add safe.directory "$(pwd)"
mise run build:all
aur-changes:
name: Check AUR-relevant changes
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
outputs:
app_changed: ${{ steps.changed.outputs.app_changed }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Check changed files
id: changed
env:
BEFORE_SHA: ${{ github.event.before }}
AFTER_SHA: ${{ github.sha }}
run: |
set -euo pipefail
if [[ "$BEFORE_SHA" =~ ^0+$ ]]; then
BEFORE_SHA="$(git rev-list --max-parents=0 "$AFTER_SHA")"
fi
app_changed=false
while IFS= read -r file; do
case "$file" in
*.go|go.mod|go.sum|LICENSE|mise.toml|config/*|homeassistant/*|notify/*|tui/*|.scripts/version.sh|.scripts/linux/PKGBUILD|.scripts/linux/prepare-aur.sh|.scripts/linux/arch-package.install|.scripts/linux/go-automate-home-assistant-bridge.service)
app_changed=true
break
;;
esac
done < <(git diff --name-only "$BEFORE_SHA" "$AFTER_SHA")
echo "app_changed=$app_changed" >> "$GITHUB_OUTPUT"
if [ "$app_changed" = "true" ]; then
echo "AUR-relevant changes detected."
else
echo "No AUR-relevant changes detected. Skipping AUR update."
fi
prepare-aur:
name: Prepare AUR package (go-automate-git)
runs-on: ubuntu-latest
needs:
- build
- aur-changes
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.aur-changes.outputs.app_changed == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0 # Need full history for version calculation
- name: Prepare AUR package files
run: .scripts/linux/prepare-aur.sh "${{ runner.temp }}/aur-package"
- name: Upload AUR package files
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: aur-go-automate-git-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/aur-package
if-no-files-found: error
retention-days: 1
update-aur:
name: Update AUR (go-automate-git)
needs:
- aur-changes
- prepare-aur
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.aur-changes.outputs.app_changed == 'true'
permissions:
contents: read
uses: >- # master
timmo001/workflows/.github/workflows/publish-aur.yml@b1d37bf9247fadf3209395cd6bdcbd55c9989370
with:
package-name: go-automate-git
artifact-name: aur-go-automate-git-${{ github.run_id }}-${{ github.run_attempt }}
pkgbuild-path: PKGBUILD
auxiliary-file-paths: arch-package.install
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}