Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions .github/workflows/beta-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 4 additions & 4 deletions beta/beta-branch.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: |
Expand Down
22 changes: 7 additions & 15 deletions beta/beta-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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