From 5698fc666bdeb2eca7c63edd46a81b03b3677307 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 8 Jul 2023 14:47:59 -0700 Subject: [PATCH] CI: no longer push subrepos (all repos are standalone) Signed-off-by: Stephen Gutekanst --- .github/push-subrepos.sh | 61 ----------------------------- .github/workflows/push_subrepos.yml | 28 ------------- 2 files changed, 89 deletions(-) delete mode 100755 .github/push-subrepos.sh delete mode 100644 .github/workflows/push_subrepos.yml diff --git a/.github/push-subrepos.sh b/.github/push-subrepos.sh deleted file mode 100755 index dbd09642..00000000 --- a/.github/push-subrepos.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "${BASH_SOURCE[0]}")"/.. - -push_subrepo() { - local project=$1 - - echo " ----------------------------------------------------------------------------" - echo " | 🚀🐒 Preparing: mach-$project" - echo " ----------------------------------------------------------------------------" - cp -R staging-clean staging/ - cd staging/ - - # Rewrite e.g. libs/freetype/ -> freetype/ so we have Git history for that subrepo in one path - # only (git subtree cannot follow renames.) For glfw, gpu-dawn, and freetype they were in the - # root before being under libs/ and so this is required to generate the proper history. - if [[ "$project" == "glfw" ]]; then - # glfw has an unfortunately non-linear history, and so we can't preserve commit hashes - # or else the subtree push cannot rebuild history properly. - git filter-repo --force \ - --path $project \ - --path "libs/$project" \ - --path-rename libs/$project:$project - else - git filter-repo --force \ - --preserve-commit-hashes \ - --path $project \ - --path "libs/$project" \ - --path-rename libs/$project:$project - fi - - # Push changes to the external subrepo. - if [ -n "${GITHUB_ACTIONS:-}" ]; then - git remote add -f "mach-$project" "https://slimsag:$ACCESS_TOKEN@github.com/hexops/mach-$project" || true - else - git remote add -f "mach-$project" "git@github.com:hexops/mach-$project" || true - fi - git fetch "mach-$project" - - echo " ----------------------------------------------------------------------------" - echo " | 🚀🐒 Pushing: mach-$project" - echo " ----------------------------------------------------------------------------" - git subtree push --prefix "$project" "mach-$project" main - - cd .. - rm -rf staging/ - echo " ----------------------------------------------------------------------------" - echo " | 🚀🐒 Finished: mach-$project" - echo " ----------------------------------------------------------------------------" -} - -rm -rf staging-clean/ staging/ -git clone https://github.com/hexops/mach staging-clean - -push_subrepo 'core' -push_subrepo 'freetype' -push_subrepo 'gpu' -push_subrepo 'gpu-dawn' -push_subrepo 'sysaudio' - -rm -rf staging-clean diff --git a/.github/workflows/push_subrepos.yml b/.github/workflows/push_subrepos.yml deleted file mode 100644 index b1f8fbfd..00000000 --- a/.github/workflows/push_subrepos.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Push to subrepositories -on: - push: - branches: - - "main" - path: - - "libs/**" -jobs: - push: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # fetch full Git history, otherwise push-subrepos.sh would fail due to not being able to - # split the git subtree. - fetch-depth: 0 - - name: Install git-filter-repo - run: python3 -m pip install --user git-filter-repo - - name: "Push recent commits to subrepositories" - env: - ACCESS_TOKEN: ${{ secrets.HEXOPS_MACH_PUSH_SUBREPOS }} - run: | - git config user.name 'Repository synchronization automation' - git config user.email 'stephen@hexops.com' - # See https://github.community/t/automating-push-to-public-repo/17742/12 - git config -l | grep 'http\..*\.extraheader' | cut -d= -f1 | xargs -L1 git config --unset-all - ./.github/push-subrepos.sh