mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Add cargo display options to rust buildsystem. (#12309)
* Add cargo display options to rust buildsystem. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust Generate-PR workflow. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust more workflows Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a06c42c587
commit
6c995408ba
264
.github/workflows/Build.yml
vendored
264
.github/workflows/Build.yml
vendored
@@ -291,162 +291,11 @@ jobs:
|
|||||||
git commit -m "${{ inputs.branch || github.ref_name }}: Build Run on ${PLATFORM}." && git push
|
git commit -m "${{ inputs.branch || github.ref_name }}: Build Run on ${PLATFORM}." && git push
|
||||||
git log --oneline -10
|
git log --oneline -10
|
||||||
fi
|
fi
|
||||||
update-package-files:
|
|
||||||
strategy:
|
|
||||||
max-parallel: 1
|
|
||||||
matrix:
|
|
||||||
arch: [i686, x86_64, armv7l]
|
|
||||||
runner:
|
|
||||||
- ubuntu-24.04
|
|
||||||
- ubuntu-24.04-arm
|
|
||||||
exclude:
|
|
||||||
- arch: x86_64
|
|
||||||
runner: ubuntu-24.04-arm
|
|
||||||
- arch: i686
|
|
||||||
runner: ubuntu-24.04-arm
|
|
||||||
- arch: armv7l
|
|
||||||
runner: ubuntu-24.04
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
needs:
|
|
||||||
- setup
|
|
||||||
- generate
|
|
||||||
env:
|
|
||||||
CREW_REPO: ${{ github.event.repository.clone_url }}
|
|
||||||
CREW_BRANCH: ${{ inputs.branch || github.ref_name }}
|
|
||||||
TARGET_ARCH: ${{ matrix.arch }}
|
|
||||||
TIMESTAMP: ${{ needs.setup.outputs.timestamp }}
|
|
||||||
GLIBC_232_COMPATIBLE_PACKAGES: ${{ needs.setup.outputs.glibc_232_compat }}
|
|
||||||
GLIBC_237_COMPATIBLE_PACKAGES: ${{ needs.setup.outputs.glibc_237_compat }}
|
|
||||||
i686_PACKAGES: ${{ needs.setup.outputs.i686_packages }}
|
|
||||||
x86_64_PACKAGES: ${{ needs.setup.outputs.x86_64_packages }}
|
|
||||||
armv7l_PACKAGES: ${{ needs.setup.outputs.armv7l_packages }}
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
concurrency:
|
|
||||||
group: ${{ matrix.arch }}-${{ github.workflow }}-${{ inputs.branch || github.ref_name }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
steps:
|
|
||||||
- name: Fail if build jobs failed
|
|
||||||
if: ${{ contains(needs.*.result, 'failure') }}
|
|
||||||
run: exit 1
|
|
||||||
- name: Dump GitHub context
|
|
||||||
env:
|
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
||||||
run: echo "$GITHUB_CONTEXT"
|
|
||||||
- name: Dump job context
|
|
||||||
env:
|
|
||||||
JOB_CONTEXT: ${{ toJson(job) }}
|
|
||||||
run: echo "$JOB_CONTEXT"
|
|
||||||
- name: Dump steps context
|
|
||||||
env:
|
|
||||||
STEPS_CONTEXT: ${{ toJson(steps) }}
|
|
||||||
run: echo "$STEPS_CONTEXT"
|
|
||||||
- name: Dump runner context
|
|
||||||
env:
|
|
||||||
RUNNER_CONTEXT: ${{ toJson(runner) }}
|
|
||||||
run: echo "$RUNNER_CONTEXT"
|
|
||||||
- name: Dump strategy context
|
|
||||||
env:
|
|
||||||
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
|
|
||||||
run: echo "$STRATEGY_CONTEXT"
|
|
||||||
- name: Dump matrix context
|
|
||||||
env:
|
|
||||||
MATRIX_CONTEXT: ${{ toJson(matrix) }}
|
|
||||||
run: echo "$MATRIX_CONTEXT"
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
persist-credentials: true
|
|
||||||
- name: Export target docker container to github context
|
|
||||||
run: |
|
|
||||||
case $TARGET_ARCH in
|
|
||||||
x86_64)
|
|
||||||
echo "CONTAINER=satmandu/crew-pre-glibc-standalone:nocturne-x86_64.m90" >> "$GITHUB_ENV"
|
|
||||||
echo "PLATFORM=linux/amd64" >> "$GITHUB_ENV"
|
|
||||||
echo "LIB_SUFFIX=64" >> "$GITHUB_ENV"
|
|
||||||
;;
|
|
||||||
armv7l)
|
|
||||||
echo "CONTAINER=satmandu/crew-pre-glibc-standalone:fievel-armv7l.m91" >> "$GITHUB_ENV"
|
|
||||||
echo "PLATFORM=linux/arm/v7" >> "$GITHUB_ENV"
|
|
||||||
echo "LIB_SUFFIX=" >> "$GITHUB_ENV"
|
|
||||||
;;
|
|
||||||
i686)
|
|
||||||
# There is only one i686 container based upon M58 with glibc 2.23.
|
|
||||||
echo "CONTAINER=satmandu/crew-pre-glibc-standalone:alex-i686.m58" >> "$GITHUB_ENV"
|
|
||||||
echo "PLATFORM=linux/386" >> "$GITHUB_ENV"
|
|
||||||
echo "LIB_SUFFIX=" >> "$GITHUB_ENV"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
- name: Run Updater in container
|
|
||||||
id: run-updater
|
|
||||||
if: ${{ contains(needs.*.result, 'failure') || !cancelled() }}
|
|
||||||
run: |
|
|
||||||
if [ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${armv7l_PACKAGES}" ]; then
|
|
||||||
# Exit the arm container if there are not armv7l compatible packages.
|
|
||||||
echo "Skipping armv7l container builds &/or package file updates"
|
|
||||||
exit 0
|
|
||||||
elif [ "$PLATFORM" == 'linux/amd64' ] && [ -z "${x86_64_PACKAGES}" ]; then
|
|
||||||
# Exit the x86_64 container if there are not x86_64 compatible packages.
|
|
||||||
echo "Skipping x86_64 container builds &/or package file updates"
|
|
||||||
exit 0
|
|
||||||
elif [ "$PLATFORM" == 'linux/386' ] && [ -z "${i686_PACKAGES}" ]; then
|
|
||||||
# Exit the i686 container if there are not i686 compatible packages.
|
|
||||||
echo "Skipping i686 container builds &/or package file updates"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
git fetch origin
|
|
||||||
git checkout "${{ inputs.branch || github.ref_name }}"
|
|
||||||
git reset --hard "origin/${{ inputs.branch || github.ref_name }}"
|
|
||||||
git log --oneline -10
|
|
||||||
docker pull --platform "${PLATFORM}" "${CONTAINER}"
|
|
||||||
sudo apt install -y acl
|
|
||||||
# Detection of /output/pkg_cache dir triggers setting
|
|
||||||
# CREW_CACHE_DIR=1 and CREW_CACHE_ENABLED=1 in the build
|
|
||||||
# container. Without these, upload fails.
|
|
||||||
mkdir pkg_cache
|
|
||||||
sudo setfacl -R -m u:1000:rwx .
|
|
||||||
# See https://github.com/containerd/containerd/pull/7566#issuecomment-1461134737 for why we set ulimit.
|
|
||||||
docker run \
|
|
||||||
--rm \
|
|
||||||
--platform "${PLATFORM}" \
|
|
||||||
-e PUID=1000 \
|
|
||||||
-e PGID=1000 \
|
|
||||||
--privileged \
|
|
||||||
-e GCONV_PATH="/usr/local/lib${LIB_SUFFIX}/gconv" \
|
|
||||||
-e CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES="${CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES}" \
|
|
||||||
-e CREW_REPO="${CREW_REPO}" \
|
|
||||||
-e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \
|
|
||||||
-e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \
|
|
||||||
-e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \
|
|
||||||
-v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \
|
|
||||||
-v "$(pwd)":/output:rshared \
|
|
||||||
--tmpfs /tmp \
|
|
||||||
--ulimit "nofile=$(ulimit -Sn):$(ulimit -Hn)" \
|
|
||||||
"${CONTAINER}" \
|
|
||||||
/bin/chromebrewstart "/output/tools/github_actions_update_builder_allowing_failures.sh" > >(tee -a /tmp/build.log) 2> >(tee -a /tmp/build.log >&2)
|
|
||||||
grep "Built and Uploaded:" /tmp/build.log || true
|
|
||||||
echo "Deleting build output directories."
|
|
||||||
sudo rm -rf release pkg_cache
|
|
||||||
- name: Add updated packages to branch.
|
|
||||||
id: push-check
|
|
||||||
run: |
|
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
|
||||||
git config user.name "${{ github.actor }}"
|
|
||||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
|
||||||
git config pull.ff only
|
|
||||||
git stash || true
|
|
||||||
git pull
|
|
||||||
git stash pop || true
|
|
||||||
git add -A
|
|
||||||
git commit -m "${{ inputs.branch || github.ref_name }}: Package File Update Run on ${PLATFORM} container." && git push
|
|
||||||
git log --oneline -10
|
|
||||||
fi
|
|
||||||
build-check:
|
build-check:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs:
|
needs:
|
||||||
- setup
|
- setup
|
||||||
- generate
|
- generate
|
||||||
- update-package-files
|
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Fail if update or build jobs failed, otherwise create a PR
|
- name: Fail if update or build jobs failed, otherwise create a PR
|
||||||
@@ -454,115 +303,10 @@ jobs:
|
|||||||
run: exit 1
|
run: exit 1
|
||||||
- name: Report update & build success
|
- name: Report update & build success
|
||||||
run: echo "Update & build jobs succeeded. Creating a PR."
|
run: echo "Update & build jobs succeeded. Creating a PR."
|
||||||
- name: Get GH Token
|
- name: Trigger PR workflow
|
||||||
id: get_workflow_token
|
|
||||||
uses: peter-murray/workflow-application-token-action@v4
|
|
||||||
with:
|
|
||||||
application_id: ${{ secrets.APPLICATION_ID }}
|
|
||||||
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
|
|
||||||
organization: chromebrew
|
|
||||||
revoke_token: true
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
persist-credentials: true
|
|
||||||
ref: ${{ inputs.branch || github.ref_name }}
|
|
||||||
token: ${{ steps.get_workflow_token.outputs.token }}
|
|
||||||
- name: Rebase to master and save git log
|
|
||||||
id: rebase-and-git-log
|
|
||||||
run: |
|
|
||||||
git config user.name "${{ github.actor }}"
|
|
||||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
|
||||||
git fetch origin
|
|
||||||
git checkout "${{ inputs.branch || github.ref_name }}"
|
|
||||||
git reset --hard "origin/${{ inputs.branch || github.ref_name }}"
|
|
||||||
git pull --rebase origin master && git push -f
|
|
||||||
git log --oneline -10
|
|
||||||
git checkout master && git pull
|
|
||||||
git log --oneline master..${{ inputs.branch || github.ref_name }} | tr '\n' '\0' | xargs -0 -n1 echo "- $*" >> /tmp/commits.txt
|
|
||||||
git checkout "${{ inputs.branch || github.ref_name }}"
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v46
|
|
||||||
with:
|
|
||||||
base_sha: master
|
|
||||||
files_yaml: |
|
|
||||||
manifest:
|
|
||||||
- manifest/**
|
|
||||||
packages:
|
|
||||||
- packages/*.rb
|
|
||||||
github:
|
|
||||||
- .github/**
|
|
||||||
other:
|
|
||||||
- ./**
|
|
||||||
- '!manifest/**'
|
|
||||||
- '!packages/*.rb'
|
|
||||||
- '!.github/**'
|
|
||||||
- name: Create Pull Request
|
|
||||||
if: ${{ github.event.inputs.with_pr != 'No' }}
|
if: ${{ github.event.inputs.with_pr != 'No' }}
|
||||||
|
id: trigger-pr-workflow
|
||||||
env:
|
env:
|
||||||
CHANGED_GITHUB_CONFIG_FILES: ${{ steps.changed-files.outputs.github_all_changed_files }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
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 }}
|
|
||||||
GH_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
|
|
||||||
PR_TYPE: ${{ github.event.inputs.with_pr }}
|
|
||||||
TIMESTAMP: ${{ needs.setup.outputs.timestamp }}
|
|
||||||
i686_PACKAGES: ${{ needs.setup.outputs.i686_packages }}
|
|
||||||
x86_64_PACKAGES: ${{ needs.setup.outputs.x86_64_packages }}
|
|
||||||
armv7l_PACKAGES: ${{ needs.setup.outputs.armv7l_packages }}
|
|
||||||
run: |
|
run: |
|
||||||
rm -rf /tmp/pr.txt
|
gh workflow -R chromebrew/chromebrew run Generate-PR.yml -f branch="${{ inputs.branch || github.ref_name }}" -f draft_pr="${{ github.event.inputs.with_pr == 'Draft Pull Request' }}"
|
||||||
echo -e "## Description" >> /tmp/pr.txt
|
|
||||||
echo -e "- This PR was built using the Build.yml workflow, which was pointed to the ${{ inputs.branch || github.ref_name }} branch.\n" >> /tmp/pr.txt
|
|
||||||
echo -e "#### Commits:" >> /tmp/pr.txt
|
|
||||||
# Get git log from rebase-and-git-log step.
|
|
||||||
cat /tmp/commits.txt >> /tmp/pr.txt
|
|
||||||
if [[ "${CHANGED_GITHUB_CONFIG_FILES}" != "" ]]; then
|
|
||||||
echo -e "### Updated GitHub configuration files:" >> /tmp/pr.txt
|
|
||||||
for file in ${CHANGED_GITHUB_CONFIG_FILES}
|
|
||||||
do
|
|
||||||
echo "- ${file}" >> /tmp/pr.txt
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [[ "${CHANGED_PACKAGES}" != "" ]]; then
|
|
||||||
echo -e "### Packages with Updated versions or Changed package files:" >> /tmp/pr.txt
|
|
||||||
for file in ${CHANGED_PACKAGES}
|
|
||||||
do
|
|
||||||
echo "- ${file}" >> /tmp/pr.txt
|
|
||||||
done
|
|
||||||
echo -e "##\nBuilds attempted for:" >> /tmp/pr.txt
|
|
||||||
[ -n "${x86_64_PACKAGES}" ] && echo -e "- [x] \`x86_64\`" >> /tmp/pr.txt
|
|
||||||
[ -n "${i686_PACKAGES}" ] && echo -e "- [x] \`i686\`" >> /tmp/pr.txt
|
|
||||||
[ -n "${armv7l_PACKAGES}" ] && echo -e "- [x] \`armv7l\`" >> /tmp/pr.txt
|
|
||||||
fi
|
|
||||||
if [[ "${CHANGED_OTHER_FILES}" != "" ]]; then
|
|
||||||
echo -e "### Other changed files:" >> /tmp/pr.txt
|
|
||||||
for file in ${CHANGED_OTHER_FILES}
|
|
||||||
do
|
|
||||||
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=${{ inputs.branch || github.ref_name }} crew update \\" >> /tmp/pr.txt
|
|
||||||
echo -e "&& yes | crew upgrade\n\`\`\`" >> /tmp/pr.txt
|
|
||||||
cat /tmp/pr.txt
|
|
||||||
[[ $PR_TYPE == 'Draft Pull Request' ]] && export PR_DRAFT_FLAG='-d'
|
|
||||||
if [[ -z ${PR_NUMBER} ]]; then
|
|
||||||
PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "${{ inputs.branch || github.ref_name }}: Build for ${CHANGED_PACKAGES}" -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev)
|
|
||||||
else
|
|
||||||
gh pr edit --title "${{ inputs.branch || github.ref_name }}: Build for ${CHANGED_PACKAGES}" -F /tmp/pr.txt
|
|
||||||
fi
|
|
||||||
# Draft PRs can not be set to automerge.
|
|
||||||
if [[ PR_TYPE == 'Draft Pull Request' ]]; then
|
|
||||||
gh pr ready --undo || true
|
|
||||||
else
|
|
||||||
gh pr merge --auto || true
|
|
||||||
fi
|
|
||||||
echo "PR_NUMBER is ${PR_NUMBER}"
|
|
||||||
echo "PR_NUMBER=${PR_NUMBER}" >> "$GITHUB_ENV"
|
|
||||||
# Trigger workflow run:
|
|
||||||
gh workflow run Unit-Test.yml ${PR_NUMBER}
|
|
||||||
|
|||||||
106
.github/workflows/Updater.yml
vendored
106
.github/workflows/Updater.yml
vendored
@@ -15,9 +15,6 @@ jobs:
|
|||||||
update-check:
|
update-check:
|
||||||
if: ${{ github.repository_owner == 'chromebrew' }}
|
if: ${{ github.repository_owner == 'chromebrew' }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
outputs:
|
|
||||||
timestamp: ${{ steps.set-variables.outputs.TIMESTAMP }} # https://stackoverflow.com/a/75142892
|
|
||||||
update_branch_name: ${{ steps.set-variables.outputs.UPDATE_BRANCH_NAME }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -38,82 +35,43 @@ jobs:
|
|||||||
make -j "$(nproc)"
|
make -j "$(nproc)"
|
||||||
sudo make install
|
sudo make install
|
||||||
sudo gem install ruby-libversion
|
sudo gem install ruby-libversion
|
||||||
- name: Set workflow & branch variables
|
|
||||||
id: set-variables
|
|
||||||
run: |
|
|
||||||
export TIMESTAMP="$(date -u +%F-%H-%M)"
|
|
||||||
export UPDATE_BRANCH_NAME="automatic-updates-${TIMESTAMP}"
|
|
||||||
echo "TIMESTAMP=${TIMESTAMP}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "UPDATE_BRANCH_NAME=${UPDATE_BRANCH_NAME}" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Git setup
|
|
||||||
env:
|
|
||||||
UPDATE_BRANCH_NAME: ${{ steps.set-variables.outputs.UPDATE_BRANCH_NAME }}
|
|
||||||
run: |
|
|
||||||
git pull && ( git checkout -b "${UPDATE_BRANCH_NAME}" || git checkout "${UPDATE_BRANCH_NAME}" )
|
|
||||||
- name: Check for updates in pip packages.
|
- name: Check for updates in pip packages.
|
||||||
id: pip-update-checks
|
id: pip-update-checks
|
||||||
env:
|
|
||||||
UPDATE_BRANCH_NAME: ${{ steps.set-variables.outputs.UPDATE_BRANCH_NAME }}
|
|
||||||
run: |
|
run: |
|
||||||
|
git pull
|
||||||
|
git stash drop || true
|
||||||
LD_LIBRARY_PATH=/usr/local/lib ruby tools/update_python_pip_packages.rb
|
LD_LIBRARY_PATH=/usr/local/lib ruby tools/update_python_pip_packages.rb
|
||||||
# Create a new branch with the updated package files only
|
export TIMESTAMP="$(date -u +%F-%H-%M)"
|
||||||
# if there are updated packages. Otherwise exit early.
|
for i in $(git status --porcelain | awk '{print $2}' | grep ^packages/)
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
do
|
||||||
echo "Python pip packages were updated."
|
git stash pop || true
|
||||||
git config user.name "${{ github.actor }}"
|
git add $i
|
||||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
pkg=${i%.rb}
|
||||||
git add -A
|
pkg=${pkg#packages/}
|
||||||
git commit -m "Add unbuilt updated pip packages to ${UPDATE_BRANCH_NAME}"
|
git checkout -b "${pkg}-${TIMESTAMP}" || git checkout "${pkg}-${TIMESTAMP}"
|
||||||
echo "PIP_UPDATED=true" >> "$GITHUB_OUTPUT"
|
git commit -m "Add unbuilt ${pkg} to ${pkg}-${TIMESTAMP}"
|
||||||
else
|
git push
|
||||||
echo "Python pip packages were not updated."
|
gh workflow -R chromebrew/chromebrew run Build.yml -f branch="${pkg}-${TIMESTAMP}"
|
||||||
echo "PIP_UPDATED=false" >> "$GITHUB_OUTPUT"
|
git stash || true
|
||||||
fi
|
git checkout master
|
||||||
- name: Push pip package changes
|
done
|
||||||
if: ${{ steps.pip-update-checks.outputs.PIP_UPDATED == 'true' }}
|
|
||||||
uses: ad-m/github-push-action@master
|
|
||||||
with:
|
|
||||||
branch: ${{ steps.set-variables.outputs.UPDATE_BRANCH_NAME }}
|
|
||||||
- name: Check for updates in ruby gem packages.
|
- name: Check for updates in ruby gem packages.
|
||||||
id: gem-update-checks
|
id: gem-update-checks
|
||||||
env:
|
|
||||||
UPDATE_BRANCH_NAME: ${{ steps.set-variables.outputs.UPDATE_BRANCH_NAME }}
|
|
||||||
run: |
|
run: |
|
||||||
|
git pull
|
||||||
|
git stash drop || true
|
||||||
LD_LIBRARY_PATH=/usr/local/lib ruby tools/update_ruby_gem_packages.rb
|
LD_LIBRARY_PATH=/usr/local/lib ruby tools/update_ruby_gem_packages.rb
|
||||||
# Create a new branch with the updated package files only
|
export TIMESTAMP="$(date -u +%F-%H-%M)"
|
||||||
# if there are updated packages. Otherwise exit early.
|
for i in $(git status --porcelain | awk '{print $2}' | grep ^packages/)
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
do
|
||||||
echo "Ruby gem packages were updated."
|
git stash pop || true
|
||||||
git config user.name "${{ github.actor }}"
|
git add $i
|
||||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
pkg=${i%.rb}
|
||||||
git add -A
|
pkg=${pkg#packages/}
|
||||||
git commit -m "Add unbuilt updated ruby gem packages to ${UPDATE_BRANCH_NAME}"
|
git checkout -b "${pkg}-${TIMESTAMP}" || git checkout "${pkg}-${TIMESTAMP}"
|
||||||
echo "GEM_UPDATED=true" >> "$GITHUB_OUTPUT"
|
git commit -m "Add unbuilt ${pkg} to ${pkg}-${TIMESTAMP}"
|
||||||
else
|
git push
|
||||||
echo "Ruby gem packages were not updated."
|
gh workflow -R chromebrew/chromebrew run Build.yml -f branch="${pkg}-${TIMESTAMP}"
|
||||||
echo "GEM_UPDATED=false" >> "$GITHUB_OUTPUT"
|
git stash || true
|
||||||
fi
|
git checkout master
|
||||||
- name: Push ruby gem package changes
|
done
|
||||||
if: ${{ steps.gem-update-checks.outputs.GEM_UPDATED == 'true' }}
|
|
||||||
uses: ad-m/github-push-action@master
|
|
||||||
with:
|
|
||||||
branch: ${{ steps.set-variables.outputs.UPDATE_BRANCH_NAME }}
|
|
||||||
- name: Cancel if no updates
|
|
||||||
id: no-update-cancel
|
|
||||||
if: ${{ ( steps.pip-update-checks.outputs.PIP_UPDATED == 'false' ) && ( steps.gem-update-checks.outputs.GEM_UPDATED == 'false' ) }}
|
|
||||||
run: |
|
|
||||||
echo "PIP_UPDATED is ${{ steps.pip-update-checks.outputs.PIP_UPDATED }}."
|
|
||||||
echo "GEM_UPDATED is ${{ steps.gem-update-checks.outputs.GEM_UPDATED }}."
|
|
||||||
git checkout master && git branch -D "${{ steps.set-variables.outputs.UPDATE_BRANCH_NAME }}" && git push
|
|
||||||
# https://stackoverflow.com/a/75809743
|
|
||||||
gh run cancel "${{ github.run_id }}"
|
|
||||||
gh run watch "${{ github.run_id }}"
|
|
||||||
dispatch-build:
|
|
||||||
if: ${{ github.repository_owner == 'chromebrew' }}
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: update-check
|
|
||||||
env:
|
|
||||||
UPDATE_BRANCH_NAME: ${{ needs.update-check.outputs.update_branch_name }}
|
|
||||||
steps:
|
|
||||||
- name: gh_workflow_dispatch
|
|
||||||
run: gh workflow -R chromebrew/chromebrew run Build.yml -f branch="${UPDATE_BRANCH_NAME}"
|
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ class RUST < Package
|
|||||||
@rustflags = "#{ENV.fetch('RUSTFLAGS', nil)} #{@rust_flags}"
|
@rustflags = "#{ENV.fetch('RUSTFLAGS', nil)} #{@rust_flags}"
|
||||||
rust_env =
|
rust_env =
|
||||||
{
|
{
|
||||||
LD: 'mold',
|
CARGO_TERM_COLOR: 'always',
|
||||||
LIBRARY_PATH: CREW_LIB_PREFIX,
|
CARGO_TERM_PROGRESS_WHEN: 'always',
|
||||||
PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil),
|
LD: 'mold',
|
||||||
RUSTFLAGS: @rustflags
|
LIBRARY_PATH: CREW_LIB_PREFIX,
|
||||||
|
PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil),
|
||||||
|
RUSTFLAGS: @rustflags
|
||||||
}.transform_keys(&:to_s)
|
}.transform_keys(&:to_s)
|
||||||
|
|
||||||
@channel_flag = @rust_channel.to_s.empty? ? '' : "+#{@rust_channel}"
|
@channel_flag = @rust_channel.to_s.empty? ? '' : "+#{@rust_channel}"
|
||||||
@@ -41,10 +43,12 @@ class RUST < Package
|
|||||||
def self.install
|
def self.install
|
||||||
rust_env =
|
rust_env =
|
||||||
{
|
{
|
||||||
LD: 'mold',
|
CARGO_TERM_COLOR: 'always',
|
||||||
LIBRARY_PATH: CREW_LIB_PREFIX,
|
CARGO_TERM_PROGRESS_WHEN: 'always',
|
||||||
PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil),
|
LD: 'mold',
|
||||||
RUSTFLAGS: @rustflags
|
LIBRARY_PATH: CREW_LIB_PREFIX,
|
||||||
|
PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil),
|
||||||
|
RUSTFLAGS: @rustflags
|
||||||
}.transform_keys(&:to_s)
|
}.transform_keys(&:to_s)
|
||||||
|
|
||||||
@rust_install_path.split.each do |path|
|
@rust_install_path.split.each do |path|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ require 'etc'
|
|||||||
require 'open3'
|
require 'open3'
|
||||||
|
|
||||||
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
||||||
CREW_VERSION ||= '1.63.7' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
CREW_VERSION ||= '1.63.8' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||||
|
|
||||||
# Kernel architecture.
|
# Kernel architecture.
|
||||||
KERN_ARCH ||= Etc.uname[:machine]
|
KERN_ARCH ||= Etc.uname[:machine]
|
||||||
|
|||||||
Reference in New Issue
Block a user