Skip to content

install upmpdcli for DLNA #91

install upmpdcli for DLNA

install upmpdcli for DLNA #91

Workflow file for this run

name: build base image
on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/build_base.yml'
- 'build_base.sh'
- 'tuning/**'
- 'services/kdeconnect.service'
- 'services/wlan0-power.service'
- 'packages/setup_pipewire.sh'
- 'packages/setup_kdeconnect.sh'
- 'packages/setup_balena_wifi.sh'
- 'packages/wifi-connect/**'
- 'packages/wifi-connect.bin'
- 'patches/firstboot'
- 'patches/userconf'
- 'patches/boot_config.txt'
jobs:
# Stage 1: Get Current Date and Release Name
get-date-release-name:
runs-on: ubuntu-latest
outputs:
release_name: ${{ steps.current-date.outputs.release_name }}
cache_key: ${{ steps.current-date.outputs.cache_key }}
steps:
- name: Get Current Date and Release Name
id: current-date
run: |
current_date=$(date +'%Y-%m-%d')
release_name="raspOVOS-NO-OVOS-bookworm-arm64-lite-${current_date}"
cache_key="raspOVOS-${{ github.run_id }}"
echo "release_name=$release_name" >> $GITHUB_OUTPUT
echo "cache_key=$cache_key" >> $GITHUB_OUTPUT
- name: Print outputs
shell: bash
run: |
echo "cache_key: ${{ steps.current-date.outputs.cache_key }}"
echo "release_name: ${{ steps.current-date.outputs.release_name }}"
# Stage 2: Build Image
modify-rpi-image:
runs-on: ubuntu-latest
needs: get-date-release-name
outputs:
image-path: ${{ steps.create-image.outputs.image-path }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Tune base Raspberry Pi OS Bookworm
uses: TigreGotico/rpi-image-modifier@main
id: create-image
env:
USER: 'ovos'
PASSWORD: 'ovos'
HOSTNAME: "raspOVOS"
with:
base-image-url: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64-lite.img.xz
image-path: raspOVOS-NO-OVOS-bookworm-arm64-lite.img
compress-with-xz: true
cache: false
shrink: true
mount-repository: true
env-vars: USER,PASSWORD,HOSTNAME
script-path: build_base.sh
- name: Print outputs
shell: bash
run: |
echo "image-path: ${{ steps.create-image.outputs.image-path }}"
echo "image-size: ${{ steps.create-image.outputs.image-size }}"
echo "image-sha256sum: ${{ steps.create-image.outputs.image-sha256sum }}"
- name: Save Image to Cache
uses: actions/cache@v4
with:
path: .
key: ${{ needs.get-date-release-name.outputs.cache_key }}
# Stage 3: Check if Release Exists and Create if Needed
check-release-or-create:
runs-on: ubuntu-latest
needs: [ get-date-release-name, modify-rpi-image ]
outputs:
release_id: ${{ steps.get-release-id.outputs.release_id }}
steps:
- name: Check if Release Exists
id: get-release-id
run: |
release_name="${{ needs.get-date-release-name.outputs.release_name }}"
release=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/releases/tags/$release_name")
release_id=$(echo $release | jq -r .id)
if [[ "$release_id" == "null" ]]; then
release=$(curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$release_name\",\"name\":\"$release_name\",\"body\":\"Testing base OS setup only.\"}" \
"https://api.github.com/repos/${{ github.repository }}/releases")
release_id=$(echo $release | jq -r .id)
fi
echo "release_id=$release_id" >> $GITHUB_OUTPUT
- name: Print outputs
shell: bash
run: |
echo "release_id: ${{ steps.get-release-id.outputs.release_id }}"
if [[ $release_id == "null" ]]; then
echo "Failed to create release. Response: $release"
exit 1
fi
# Stage 4: Upload to Release
upload-image:
runs-on: ubuntu-latest
if: ${{ needs.check-release-or-create.outputs.release_id }}
needs: [ modify-rpi-image, check-release-or-create, get-date-release-name ]
steps:
- name: Restore Cache for Image
uses: actions/cache@v4
with:
path: .
key: ${{ needs.get-date-release-name.outputs.cache_key }}
fail-on-cache-miss: true
- name: Debug Cache Content
run: ls .
- name: Upload to release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ${{ needs.modify-rpi-image.outputs.image-path }}
release_id: ${{ needs.check-release-or-create.outputs.release_id }}
draft: false
overwrite: true
prerelease: false
verbose: true
update-headless-workflow:
runs-on: ubuntu-latest
needs: [ upload-image, get-date-release-name, modify-rpi-image ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update base-image-url in build_img.yml
run: |
sed -i '/^[^#]*base-image-url:/ {/sed/! s|base-image-url: .*|base-image-url: https://github.com/TigreGotico/raspOVOS/releases/download/${{ needs.get-date-release-name.outputs.release_name }}/${{ needs.modify-rpi-image.outputs.image-path }}|}' .github/workflows/build_img.yml
- name: Check for changes
id: check-changes
run: |
if git diff --exit-code .github/workflows/build_img.yml; then
echo "base image download url didnt change"
echo "no_changes=true" >> $GITHUB_ENV
else
echo "base image download url updated in build_img.yml"
echo "no_changes=false" >> $GITHUB_ENV
fi
- name: Create Pull Request
if: env.no_changes == 'false'
uses: peter-evans/create-pull-request@v5
with:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
token: ${{ secrets.PA_TOKEN }}
branch: "update-base-image-url-headless"
commit-message: "Update base-image-url in build_img.yml"
title: "Update base-image-url-headless"
body: |
This PR updates the base-image-url in `build_img.yml` to reflect the latest release.
labels: automated-update