From 14a7f7193cb19dadcd3b59fa68aaa0091a6de65f Mon Sep 17 00:00:00 2001 From: chiefmikey Date: Mon, 22 Aug 2022 13:57:19 -0600 Subject: [PATCH 1/4] Update beta compile to checkout gitlang main --- beta/beta-compile.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/beta/beta-compile.yml b/beta/beta-compile.yml index ebc7113b..2287d8dc 100644 --- a/beta/beta-compile.yml +++ b/beta/beta-compile.yml @@ -20,30 +20,21 @@ jobs: uses: actions/checkout@v3 with: token: ${{ secrets.DISPATCH_REPO }} - fetch-depth: 0 - - - name: Pull GitLang Main - run: | - ls -A1 | xargs rm -rf - git init -b main - git config user.name "chiefmikey" - git config user.email "wolfemikl@gmail.com" - git remote add origin https://github.com/chiefmikey/gitlang-beta.git - git remote add upstream https://github.com/chiefmikey/gitlang.git - git pull upstream main + repository: chiefmikey/gitlang - name: Merge Branches env: GH_TOKEN: ${{ secrets.DISPATCH_REPO }} run: | - echo test: $(gh pr list -s open --json headRefName | jq -r '.[] | .headRefName') + git config user.name "chiefmikey" + git config user.email "wolfemikl@gmail.com" + git remote add upstream https://github.com/chiefmikey/gitlang-beta.git + echo test: $(gh pr list -R chiefmikey/gitlang-beta -s open --json headRefName | jq -r '.[] | .headRefName') for branch in $(gh pr list -s open --json headRefName | jq -r '.[] | .headRefName'); do - git fetch origin ${branch} - git merge --allow-unrelated-histories ${branch} || true + # git fetch upstream ${branch} + git merge --allow-unrelated-histories upstream/${branch} || true done - name: Push to Main run: | - git config user.name "chiefmikey" - git config user.email "wolfemikl@gmail.com" - git push -fu origin main + git push -fu upstream main From e224ac04238e10e6a463a56cdf94862bb23c881e Mon Sep 17 00:00:00 2001 From: chiefmikey Date: Mon, 22 Aug 2022 14:01:41 -0600 Subject: [PATCH 2/4] Update beta compile to fetch depth 0 --- beta/beta-compile.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beta/beta-compile.yml b/beta/beta-compile.yml index 2287d8dc..8a5f44cb 100644 --- a/beta/beta-compile.yml +++ b/beta/beta-compile.yml @@ -21,6 +21,7 @@ jobs: with: token: ${{ secrets.DISPATCH_REPO }} repository: chiefmikey/gitlang + fetch-depth: 0 - name: Merge Branches env: @@ -31,8 +32,8 @@ jobs: git remote add upstream https://github.com/chiefmikey/gitlang-beta.git echo test: $(gh pr list -R chiefmikey/gitlang-beta -s open --json headRefName | jq -r '.[] | .headRefName') for branch in $(gh pr list -s open --json headRefName | jq -r '.[] | .headRefName'); do - # git fetch upstream ${branch} - git merge --allow-unrelated-histories upstream/${branch} || true + git fetch upstream ${branch} + git merge --allow-unrelated-histories ${branch} || true done - name: Push to Main From 32b46b86fff19e11f953a6a961e3c6f8b4256c55 Mon Sep 17 00:00:00 2001 From: chiefmikey Date: Mon, 22 Aug 2022 14:15:23 -0600 Subject: [PATCH 3/4] Remove beta build prune --- .github/workflows/beta-build.yml | 29 ++++++----------------------- beta/beta-branch.yml | 8 ++++---- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/workflows/beta-build.yml b/.github/workflows/beta-build.yml index 79b5219e..648fd649 100644 --- a/.github/workflows/beta-build.yml +++ b/.github/workflows/beta-build.yml @@ -32,38 +32,21 @@ jobs: npm install NODE_ENV=production NODE_OPTIONS=--loader=ts-node/esm webpack --mode production - - name: Prune + - name: Beta Files run : | - prune() { - echo "${1}"; - if - [ "${1}" != "." ] && - [ "${1}" != ".." ] && - [ "${1}" != "./.git" ] && - [ "${1}" != "./docs" ] && - [ "${1}" != "./beta" ] && - [ "${1}" != "./LICENSE" ] && - [ "${1}" != "./README.md" ]; then - rm -rf ${1}; - fi - } - export -f prune - find . -maxdepth 1 | while read file; do prune ${file}; done - rm docs/index.html docs/404.html docs/CNAME - mv beta/index.html beta/404.html beta/CNAME docs/ + rm -rf docs/index.html docs/404.html docs/CNAME .github mkdir .github .github/workflows mv beta/beta-compile.yml beta/beta-branch.yml .github/workflows/ + mv beta/index.html beta/404.html beta/CNAME docs/ - name: Push to Beta run: | BRANCH=${{ github.head_ref }} - echo test: ${BRANCH} - echo test: $(git status) git config user.name "chiefmikey" git config user.email "wolfemikl@gmail.com" git remote set-url --add --push origin https://github.com/chiefmikey/gitlang-beta.git + echo remote-test: $(git remote -v) git add . - git commit -am 'Build beta branch' - git reset $(git commit-tree HEAD^{tree} -m 'Update beta branch') - git push -fu origin HEAD:refs/heads/${{ github.head_ref }} + git reset $(git commit-tree HEAD^{tree} -m 'Beta Branch') + git push -fu origin HEAD:refs/heads/${BRANCH} echo "https://beta.gitlang.net" diff --git a/beta/beta-branch.yml b/beta/beta-branch.yml index 957dffd2..c90899e9 100644 --- a/beta/beta-branch.yml +++ b/beta/beta-branch.yml @@ -1,11 +1,11 @@ -name: Beta Branch +name: ${GITHUB_REF##*/} on: create jobs: - build: - name: Branch + beta-pr: + name: Beta Branch PR runs-on: ubuntu-latest permissions: contents: write @@ -22,7 +22,7 @@ jobs: token: ${{ secrets.DISPATCH_REPO }} fetch-depth: 0 - - name: Open PR + - name: Create Pull Request env: GH_TOKEN: ${{ secrets.DISPATCH_REPO }} run: | From 9a04ca5c6ec65bdc988c3cd36db6b26330f0143a Mon Sep 17 00:00:00 2001 From: chiefmikey Date: Mon, 22 Aug 2022 14:19:08 -0600 Subject: [PATCH 4/4] Add beta branch commit --- .github/workflows/beta-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta-build.yml b/.github/workflows/beta-build.yml index 648fd649..fb16adf4 100644 --- a/.github/workflows/beta-build.yml +++ b/.github/workflows/beta-build.yml @@ -45,8 +45,8 @@ jobs: git config user.name "chiefmikey" git config user.email "wolfemikl@gmail.com" git remote set-url --add --push origin https://github.com/chiefmikey/gitlang-beta.git - echo remote-test: $(git remote -v) git add . + git commit -am 'Beta Files' git reset $(git commit-tree HEAD^{tree} -m 'Beta Branch') git push -fu origin HEAD:refs/heads/${BRANCH} echo "https://beta.gitlang.net"