diff --git a/.github/workflows/beta-build.yml b/.github/workflows/beta-build.yml index 79b5219e..fb16adf4 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 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 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" 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: | diff --git a/beta/beta-compile.yml b/beta/beta-compile.yml index ebc7113b..8a5f44cb 100644 --- a/beta/beta-compile.yml +++ b/beta/beta-compile.yml @@ -20,30 +20,22 @@ jobs: uses: actions/checkout@v3 with: token: ${{ secrets.DISPATCH_REPO }} + repository: chiefmikey/gitlang 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 - - 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 fetch upstream ${branch} git merge --allow-unrelated-histories ${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