From 4bb6068ff7c7ff021c0cf4750516d17eec674974 Mon Sep 17 00:00:00 2001 From: Max Downey Twiss Date: Sun, 7 Dec 2025 02:58:31 +1100 Subject: [PATCH] Rework core and buildessential package update workflows (#13742) --- .../workflows/Container-Package-Updater.yml | 20 ---------- .../Package-Dependencies-Updater.yml | 39 ++++++++----------- .github/workflows/Updater.yml | 6 +++ 3 files changed, 22 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/Container-Package-Updater.yml diff --git a/.github/workflows/Container-Package-Updater.yml b/.github/workflows/Container-Package-Updater.yml deleted file mode 100644 index 651ba8f71..000000000 --- a/.github/workflows/Container-Package-Updater.yml +++ /dev/null @@ -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*" diff --git a/.github/workflows/Package-Dependencies-Updater.yml b/.github/workflows/Package-Dependencies-Updater.yml index 809bcf270..18c8ad3a1 100644 --- a/.github/workflows/Package-Dependencies-Updater.yml +++ b/.github/workflows/Package-Dependencies-Updater.yml @@ -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 }} diff --git a/.github/workflows/Updater.yml b/.github/workflows/Updater.yml index d57d20abc..a2cb43cc7 100644 --- a/.github/workflows/Updater.yml +++ b/.github/workflows/Updater.yml @@ -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"