mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 23:18:10 -05:00
Update Updater workflows, have version.rb deduplicate update list. (#12803)
* Update Updater workflows, have version.rb deduplicate update list. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Ignore shellcheck complaint. * Add updater exclusions. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add ruby to updater exclusion. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add tika versioning exclusion. Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
5943468777
commit
bc14d4dfb4
39
.github/workflows/Container-Package-Updater.yml
vendored
Normal file
39
.github/workflows/Container-Package-Updater.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
name: Generate Updates for Core and Buildessential Packages.
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 12 * * *' # 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' }}
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.4.5'
|
||||
- name: Install ruby-libversion # Hopefully this will get added as an Ubuntu/Debian package. https://github.com/repology/libversion/issues/35
|
||||
working-directory: ${{ runner.temp }}
|
||||
run: |
|
||||
git clone --depth 1 -b 3.0.3 https://github.com/repology/libversion
|
||||
cd libversion
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j "$(nproc)"
|
||||
sudo make install
|
||||
sudo gem install --no-update-sources -N ruby-libversion --conservative
|
||||
- name: Check for updates in core and buildessential packages.
|
||||
id: pip-update-checks
|
||||
run: |
|
||||
export CORE_PACKAGES=$(ruby bin/crew deps core)
|
||||
export BUILDESSENTIAL_PACKAGES=$(ruby bin/crew deps buildessential)
|
||||
# shellcheck disable=SC2116
|
||||
gh workflow -R chromebrew/chromebrew run Updater-on-Demand.yml -f version_cmd_input="$(echo ${CORE_PACKAGES} ${BUILDESSENTIAL_PACKAGES})"
|
||||
7
.github/workflows/Updater-on-Demand.yml
vendored
7
.github/workflows/Updater-on-Demand.yml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
git pull
|
||||
git stash drop || true
|
||||
echo "pwd is $(pwd)"
|
||||
LD_LIBRARY_PATH=/usr/local/lib ruby tools/version.rb -u "${{ inputs.version_cmd_input }}"
|
||||
LD_LIBRARY_PATH=/usr/local/lib ruby tools/version.rb -u -v "${{ inputs.version_cmd_input }}"
|
||||
for i in $(git status --porcelain | awk '{print $2}' | grep ^packages/)
|
||||
do
|
||||
git stash pop || true
|
||||
@@ -71,7 +71,8 @@ jobs:
|
||||
git config advice.detachedHead false
|
||||
git checkout remotes/origin/"${updater_branch}"
|
||||
git pull origin "${updater_branch}"
|
||||
git pull --rebase origin master; git push origin "HEAD:${updater_branch}" -f ; git pull origin "${updater_branch}"
|
||||
# Let build workflow handle rebasing.
|
||||
# git pull --rebase origin master; git push origin "HEAD:${updater_branch}" -f ; git pull origin "${updater_branch}"
|
||||
git stash pop || true
|
||||
else
|
||||
git checkout -b "${updater_branch}"
|
||||
@@ -81,7 +82,7 @@ jobs:
|
||||
# If there are no changes, the next step will fail, but that
|
||||
# is ok.
|
||||
git commit -m "Add unbuilt ${pkg} to ${updater_branch}" || true
|
||||
git push || true
|
||||
git push origin "HEAD:${updater_branch}" -f || true
|
||||
gh workflow -R chromebrew/chromebrew run Build.yml -f branch="${updater_branch}"
|
||||
git stash || true
|
||||
git checkout master
|
||||
|
||||
@@ -181,7 +181,11 @@ end
|
||||
# Some packges need manual adjustments of URLS for different versions.
|
||||
unless defined?(CREW_UPDATER_EXCLUDED_PKGS)
|
||||
CREW_UPDATER_EXCLUDED_PKGS = Set[
|
||||
{ pkg_name: 'py3_ldapdomaindump', comments: 'Build is broken.' }
|
||||
{ pkg_name: 'e2fsprogs', comments: 'Upstream issue: https://github.com/tytso/e2fsprogs/issues/240' },
|
||||
{ pkg_name: 'glibc', comments: 'Requires manual update' },
|
||||
{ pkg_name: 'py3_ldapdomaindump', comments: 'Build is broken.' },
|
||||
{ pkg_name: 'ruby', comments: 'Upstream issue: https://bugs.ruby-lang.org/issues/21607' },
|
||||
{ pkg_name: 'tika', comments: 'Versioning issue: https://github.com/fedora-infra/anitya/issues/1944' }
|
||||
].to_h { |h| [h[:pkg_name], h[:comments]] }
|
||||
end
|
||||
CREW_AUTOMATIC_VERSION_UPDATE_EXCLUSION_REGEX = "(#{CREW_UPDATER_EXCLUDED_PKGS.keys.map { |p| "^#{p}$" }.join('|')})" unless defined?(CREW_AUTOMATIC_VERSION_UPDATE_EXCLUSION_REGEX)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
# version.rb version 2.6 (for Chromebrew)
|
||||
# version.rb version 2.7 (for Chromebrew)
|
||||
|
||||
OPTIONS = %w[-h --help -j --json -u --update-package-files -v --verbose]
|
||||
|
||||
@@ -178,6 +178,9 @@ else
|
||||
end
|
||||
end
|
||||
|
||||
# Remove duplicates.
|
||||
filelist.uniq!
|
||||
|
||||
if filelist.length.positive?
|
||||
max_pkg_name_length = File.basename(filelist.max_by(&:length)).length - 3
|
||||
package_field_length = [max_pkg_name_length, 7].max + 1
|
||||
|
||||
Reference in New Issue
Block a user