73 lines
2.2 KiB
YAML
73 lines
2.2 KiB
YAML
name: Updating to latest Homebrewery Release
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 9,17 * * *'
|
|
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: "update-homebrewery"
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Get latest Homebrewery release via GitHub API
|
|
run: |
|
|
# 1) API-Call
|
|
resp=$(curl -sSf \
|
|
-H "Accept: application/vnd.github.v3+json" \
|
|
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \
|
|
https://api.github.com/repos/naturalcrit/homebrewery/releases/latest)
|
|
|
|
id=$( echo "$resp" | jq -r .id)
|
|
tag_name=$( echo "$resp" | jq -r .tag_name)
|
|
name=$( echo "$resp" | jq -r .name)
|
|
url=$( echo "$resp" | jq -r .url)
|
|
draft=$( echo "$resp" | jq -r .draft)
|
|
prerelease=$( echo "$resp" | jq -r .prerelease)
|
|
body_text=$( echo "$resp" | jq -r .body)
|
|
|
|
echo "ID=$id" >>"$GITHUB_ENV"
|
|
echo "TAG_NAME=$tag_name" >>"$GITHUB_ENV"
|
|
echo "NAME=$name" >>"$GITHUB_ENV"
|
|
echo "URL=$url" >>"$GITHUB_ENV"
|
|
echo "DRAFT=$draft" >>"$GITHUB_ENV"
|
|
echo "PRERELEASE=$prerelease" >>"$GITHUB_ENV"
|
|
|
|
{
|
|
echo "BODY<<EOF"
|
|
printf '%s\n' "$body_text"
|
|
echo "EOF"
|
|
} >>"$GITHUB_ENV"
|
|
|
|
- name: Debug step
|
|
run: |
|
|
echo "id: $ID"
|
|
echo "draft: $DRAFT"
|
|
echo "tag_name: $TAG_NAME"
|
|
echo "name: $NAME"
|
|
echo "url: $URL"
|
|
echo "prerelease: $PRERELEASE"
|
|
|
|
- name: Create Docker Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: ${{ env.ID > 0 && env.DRAFT != 'true' }}
|
|
with:
|
|
prerelease: ${{ env.PRERELEASE }}
|
|
name: ${{ env.NAME }}
|
|
tag_name: ${{ env.TAG_NAME }}
|
|
body: |
|
|
# Homebrewery ${{ env.$NAME }} Image
|
|
|
|
> _This is an automated Docker Image update. Nothing other than the Homebrewery version changed._
|
|
|
|
${{ env.BODY }}
|
|
|
|
See original Changelog from [${{ env.NAME }}](${{ env.URL }})
|