This repository has been archived by the owner on May 30, 2024. It is now read-only.
update_status #1742
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update_status | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: "0 */6 * * *" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.issue_github_token }} | |
CONAN_SYSREQUIRES_MODE: enabled | |
PYTHONUNBUFFERED: 1 | |
NOT_ON_C3I: 1 | |
jobs: | |
update_status: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Prepare ccache timestamp | |
id: ccache_cache_timestamp | |
run: | | |
echo "timestamp=$(date +%Y-%m-%d-%H-%M-%S)" >> $GITHUB_OUTPUT | |
- name: Configure ccache cache files | |
uses: actions/cache@v4 | |
with: | |
path: ~/.ccache | |
key: ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} | |
restore-keys: | | |
ccache- | |
- name: Install and configure ccache | |
run: | | |
sudo apt-get install ccache | |
ccache --version | |
ccache -s | |
echo "/usr/lib/ccache" >> $GITHUB_PATH | |
- name: Install and configure conan | |
run: | | |
python3 -m pip install "conan<2" | |
conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks | |
conan config set hooks.conan-center | |
conan profile new default --detect | |
conan profile update settings.compiler.libcxx=libstdc++11 default | |
conan profile update conf.tools.system.package_manager:mode=install default | |
conan profile update conf.tools.system.package_manager:sudo=True default | |
conan profile show default | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install CCB locally | |
run: python3 -m pip install . | |
- name: Clone CCI | |
run: | | |
git clone https://${{ github.repository_owner }}:$GITHUB_TOKEN@github.com/${{ github.repository_owner }}/conan-center-index.git | |
cd conan-center-index | |
git remote add upstream https://github.com/conan-io/conan-center-index.git | |
git fetch upstream | |
git checkout upstream/master | |
git config --global user.email "quentin.chateau@gmail.com" | |
git config --global user.name "Quentin Chateau via Conan Center Bot" | |
- name: Clean branches | |
run: | | |
git ls-remote --heads origin | cut -f 2 | grep refs/heads/ccb- | while read -r git_ref ; do | |
branch_name=${git_ref:11} | |
echo "::group::$branch_name" | |
wait | |
if ! git merge --no-ff --no-commit origin/$branch_name ; then | |
echo "::warning ::branch $branch_name has conflict with master" | |
elif git diff --cached --quiet ; then | |
echo "::warning ::branch $branch_name has no change from master, deleting it" | |
git push origin --delete $branch_name | |
fi | |
git merge --abort | |
echo "::endgroup::" | |
done | |
wait | |
working-directory: conan-center-index | |
- name: Update recipes | |
run: | | |
mkdir status | |
conan-center-bot auto-update-recipes \ | |
--cci conan-center-index \ | |
--github-token "$GITHUB_TOKEN" \ | |
--push-to origin \ | |
> ./status/v1-update.json | |
cat ./status/v1-update.json | |
- name: Update status issue | |
run: | | |
conan-center-bot update-status-issue \ | |
--github-token "$GITHUB_TOKEN" \ | |
./status/v1-update.json \ | |
https://github.com/${{ github.repository }}/issues/1 | |
- name: Update status issue | |
if: github.repository == 'qchateau/conan-center-bot' | |
run: | | |
conan-center-bot update-status-issue \ | |
--github-token "$GITHUB_TOKEN" \ | |
./status/v1-update.json \ | |
https://github.com/conan-io/conan-center-index/issues/3470 | |
# Sleep to avoid deploying in both workflow at the same time | |
- name: Delay before deploy | |
if: github.event_name == 'push' | |
run: sleep 300 | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ env.GITHUB_TOKEN }} | |
branch: status | |
folder: status | |
target-folder: prod | |
clean: false |