Rework core and buildessential package update workflows (#13742)

This commit is contained in:
Max Downey Twiss
2025-12-07 02:58:31 +11:00
committed by GitHub
parent b8fa601523
commit 4bb6068ff7
3 changed files with 22 additions and 43 deletions

View File

@@ -1,20 +0,0 @@
---
name: Generate Updates for Core and Buildessential Packages.
on:
schedule:
- cron: '0 8 * * *' # Daily
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }} # setting GH_TOKEN for the entire workflow
permissions: # Global permissions configuration starts here
actions: write
contents: write
packages: write
pull-requests: write # 'write' access to pull requests
jobs:
update-check:
if: ${{ github.repository_owner == 'chromebrew' }}
uses: ./.github/workflows/Package-Dependencies-Updater.yml
secrets: inherit
with:
version_cmd_input: "core buildessential*"

View File

@@ -19,34 +19,27 @@ permissions: # Global permissions configuration starts here
packages: write
pull-requests: write # 'write' access to pull requests
jobs:
update-check:
dependencies:
if: ${{ github.repository_owner == 'chromebrew' }}
runs-on: ubuntu-24.04
outputs:
packages: ${{ steps.get-dependencies.outputs.packages }}
steps:
- uses: actions/checkout@v5
with:
persist-credentials: true
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4.7'
- name: Check for updates in core and buildessential packages.
id: trigger-update-checks
run: |
set -x
# Make crew do automatic gem installs before looking for deps.
ruby bin/crew version
# Force creation of temporary device.json.
ruby bin/crew deps zstd_static
# Make sure input matches packages in existing packages list.
export INPUT="${{ inputs.version_cmd_input }}"
# shellcheck disable=SC2046,SC2155
export INPUT_PACKAGES="$(comm -12 <(ruby bin/crew list available| sort -u) <(echo $INPUT | tr ' ' '\n'| sort -u))"
if [[ -n "${INPUT_PACKAGES}" ]]; then
# shellcheck disable=SC2086,SC2155
export PACKAGES="$(ruby bin/crew deps $INPUT_PACKAGES | sort -u)"
else
echo "No valid input packages found."
exit 1
fi
# shellcheck disable=SC2086,SC2116
gh workflow -R chromebrew/chromebrew run Updater-on-Demand.yml -f version_cmd_input="$(echo ${PACKAGES})"
- name: Install bin/crew gem dependencies
run: ruby bin/crew version
- name: Get dependencies of core and buildessential packages
id: get-dependencies
run: echo "packages=$(ruby bin/crew deps ${{ inputs.version_cmd_input }} | sort | uniq | xargs | sed 's/Creating device.json.//')" >> "$GITHUB_OUTPUT"
update-check:
needs: dependencies
if: ${{ github.repository_owner == 'chromebrew' }}
uses: ./.github/workflows/Updater-on-Demand.yml
secrets: inherit
with:
version_cmd_input: ${{ needs.dependencies.outputs.packages }}

View File

@@ -24,3 +24,9 @@ jobs:
secrets: inherit
with:
version_cmd_input: "ruby_*"
core-buildessential-update-checks:
if: ${{ github.repository_owner == 'chromebrew' }}
uses: ./.github/workflows/Package-Dependencies-Updater.yml
secrets: inherit
with:
version_cmd_input: "core buildessential"