Update workflows and adjust variable in const.rb to fix updater workflow runs. (#12233)

* Fix env variable check in const.rb

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust workflows.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Remove since_last_remote_commit:true

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Handle Draft PRs.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Move manifest reporting section of PRs.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust inputs for generate PR workflow.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* workflow cleanup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add unbuilt updated pip packages to updates-2025-07-21-02-47

* Build on linux/386 to branch updates-2025-07-21-02-47.

* Updating package files for linux/386 to branch updates-2025-07-21-02-47.

* Updating package files for linux/amd64 to branch updates-2025-07-21-02-47.

* Updating package files for linux/arm/v7 to branch updates-2025-07-21-02-47.

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* ADjust PR title

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust branch name for automatic updates

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: satmandu <satmandu@users.noreply.github.com>
Co-authored-by: chromebrew-actions[bot] <chromebrew-actions[bot]@users.noreply.github.com>
Co-authored-by: Ed Reel <edreel@gmail.com>
This commit is contained in:
chromebrew-actions[bot]
2025-07-21 11:01:50 -05:00
committed by GitHub
parent 205ba1dcf8
commit 1829b8fc0e
22 changed files with 224 additions and 220 deletions

View File

@@ -3,11 +3,6 @@ name: Generate PR
on:
workflow_dispatch:
inputs:
with_pr:
description: "Create a PR from a branch."
required: false
type: boolean
default: 'true'
branch:
description: "Branch of chromebrew/chromebrew to run on, if different from this branch."
required: false
@@ -70,19 +65,20 @@ jobs:
TIMESTAMP="$(date -u +%F-%H%Z)"
export TIMESTAMP
echo "TIMESTAMP=${TIMESTAMP}" >> "$GITHUB_OUTPUT"
- name: Get all changed package files
id: changed-ruby-files
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
base_sha: master
files: packages/*.rb
since_last_remote_commit: true
files_yaml: |
packages:
- packages/*.rb
- name: Export variables to github context
id: changed-packages
run: |
# Convert "packages/foo.rb packages/bar.rb" (from steps.changed-ruby-files.outputs.all_changed_files) into "foo bar"
echo "CHANGED_PACKAGES=$(echo "${{ steps.changed-ruby-files.outputs.all_changed_files }}" | xargs basename -s .rb | xargs)" >> "$GITHUB_ENV"
echo "CHANGED_PACKAGES=$(echo "${{ steps.changed-ruby-files.outputs.all_changed_files }}" | xargs basename -s .rb | xargs)" >> "$GITHUB_OUTPUT"
# Convert "packages/foo.rb packages/bar.rb" (from steps.changed-files.outputs.packages_all_changed_files) into "foo bar"
echo "CHANGED_PACKAGES=$(echo "${{ steps.changed-files.outputs.packages_all_changed_files }}" | xargs basename -s .rb | xargs)" >> "$GITHUB_ENV"
echo "CHANGED_PACKAGES=$(echo "${{ steps.changed-files.outputs.packages_all_changed_files }}" | xargs basename -s .rb | xargs)" >> "$GITHUB_OUTPUT"
- name: Determine glibc and architecture package compatibility
id: get-compatibility
run: |
@@ -155,34 +151,23 @@ jobs:
git reset --hard "origin/${{ env.BRANCH }}"
git pull --rebase origin master && git push -f
git log --oneline -10
- name: Get all changed manifest files
id: changed-manifest-files
uses: tj-actions/changed-files@v46
with:
base_sha: master
files: manifest/**
since_last_remote_commit: true
- name: Get all changed GitHub config files
id: changed-GitHub-config-files
uses: tj-actions/changed-files@v46
with:
base_sha: master
files: .github/**
since_last_remote_commit: true
- name: Get other changed files
id: other-changed-files
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
base_sha: master
files_yaml: |
manifest:
- manifest/**
packages:
- packages/*.rb
workflow:
github:
- .github/**
crew:
other:
- ./**
- '!manifest/**'
- '!packages/*.rb'
- '!.github/**'
- 'packages/*.rb'
since_last_remote_commit: true
- name: Get GH Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v4
@@ -192,11 +177,10 @@ jobs:
organization: chromebrew
revoke_token: true
- name: Create Pull Request
if: ${{ github.event.inputs.with_pr == 'true' }}
env:
CHANGED_GITHUB_CONFIG_FILES: ${{ steps.changed-GitHub-config-files.outputs.all_changed_files }}
CHANGED_MANIFEST_FILES: ${{ steps.changed-manifest-files.outputs.all_changed_files }}
CHANGED_OTHER_FILES: ${{ steps.other-changed-files.outputs.all_changed_files }}
CHANGED_GITHUB_CONFIG_FILES: ${{ steps.changed-files.outputs.github_all_changed_files }}
CHANGED_MANIFEST_FILES: ${{ steps.changed-files.outputs.manifest_all_changed_files }}
CHANGED_OTHER_FILES: ${{ steps.changed-files.outputs.other_all_changed_files }}
CHANGED_PACKAGES: ${{ needs.setup.outputs.changed_packages }}
CREW_BRANCH: ${{ inputs.branch || github.ref_name }}
GH_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
@@ -225,9 +209,6 @@ jobs:
[ -n "${i686_PACKAGES}" ] && echo -e "- [x] \`i686\`" >> /tmp/pr.txt
[ -n "${armv7l_PACKAGES}" ] && echo -e "- [x] \`armv7l\`" >> /tmp/pr.txt
fi
if [[ "${CHANGED_MANIFEST_FILES}" == "" ]]; then
echo -e "##\n- [x] This PR has no manifest .filelist changes. _(Package changes have neither added nor removed files.)_" >> /tmp/pr.txt
fi
if [[ "${CHANGED_OTHER_FILES}" != "" ]]; then
echo -e "### Other changed files:" >> /tmp/pr.txt
for file in ${CHANGED_OTHER_FILES}
@@ -235,16 +216,20 @@ jobs:
echo "- ${file}" >> /tmp/pr.txt
done
fi
if [[ "${CHANGED_MANIFEST_FILES}" == "" ]]; then
echo -e "##\n- [x] This PR has no manifest .filelist changes. _(Package changes have neither added nor removed files.)_" >> /tmp/pr.txt
fi
echo -e "##\n### Run the following to get this pull request's changes locally for testing.\n\`\`\`bash" >> /tmp/pr.txt
echo -e "CREW_REPO=https://github.com/chromebrew/chromebrew.git CREW_BRANCH=${{ env.BRANCH }} crew update \\" >> /tmp/pr.txt
echo -e "&& yes | crew upgrade\n\`\`\`" >> /tmp/pr.txt
cat /tmp/pr.txt
PR_NUMBER=$(gh pr list -H ${CREW_BRANCH}| cut -f1)
if [[ -z ${PR_NUMBER} ]]; then
PR_NUMBER=$(gh pr create --reviewer chromebrew/active --title "Changes from ${{ env.BRANCH }} at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev)
PR_NUMBER=$(gh pr create --reviewer chromebrew/active --title "${{ env.BRANCH }} at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev)
else
gh pr edit -F /tmp/pr.txt
fi
gh pr merge "${PR_NUMBER}" --auto
# Draft PRs can not be set to automerge.
gh pr merge "${PR_NUMBER}" --auto || true
echo "PR_NUMBER is ${PR_NUMBER}"
echo "PR_NUMBER=${PR_NUMBER}" >> "$GITHUB_ENV"