Skip to content

Update timmo001/workflows digest to a884a1a #29

Update timmo001/workflows digest to a884a1a

Update timmo001/workflows digest to a884a1a #29

Workflow file for this run

---
name: CI
# yamllint disable-line rule:truthy
on:
pull_request: {}
push:
branches:
- main
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up mise
uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566
- name: Check
run: mise run check
- name: Build
run: mise run build
- name: Smoke test CLI
run: |
./dist/notes help
./dist/notes root
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
src/*|package.json|bun.lock|mise.toml|LICENSE|.scripts/linux/*)
app_changed=true
break
;;
esac
done < <(git diff --name-only "$BEFORE_SHA" "$AFTER_SHA")
echo "app_changed=$app_changed" >> "$GITHUB_OUTPUT"
prepare-aur:
name: Prepare AUR package (repo-notes-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
- 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-repo-notes-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 (repo-notes-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: timmo001/workflows/.github/workflows/publish-aur.yml@a884a1a831cd482dfeff570bda660aee5baa328c # master
with:
package-name: repo-notes-git
artifact-name: aur-repo-notes-git-${{ github.run_id }}-${{ github.run_attempt }}
pkgbuild-path: PKGBUILD
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}