Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed wiki bugs #1211

Merged
merged 1 commit into from
Feb 12, 2022
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: 14 additions & 15 deletions .github/workflows/wiki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
- '.github/workflows/wiki.yaml'
- 'wiki/**'
- src/rez/rezconfig.py
env:
CLONE_URL: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git"

jobs:
build:
Expand All @@ -29,10 +27,9 @@ jobs:
run: |
rezver=$(cat ./src/rez/utils/_version.py | grep -w _rez_version | tr '"' ' ' | awk '{print $NF}')

python update-wiki.py \
python generate-wiki.py \
--github-repo="${{ github.repository }}" \
--github-release=${rezver} \
--wiki-url="${{ env.CLONE_URL }}" \
--out="${{ github.workspace }}/out"

- uses: actions/upload-artifact@v2
Expand All @@ -47,20 +44,22 @@ jobs:
if: github.event_name == 'release'

steps:
- uses: actions/download-artifact@v2
with:
name: wiki-markdown
path: .

- name: Setup git config
run: |
git config --global user.name "github.com/${{ github.actor }}"
git config --global user.email "${{ github.actor }}@${{ github.sha }}"

- name: Git commit and push
- name: Clone latest wiki repo
run: |
git clone https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git .

- uses: actions/download-artifact@v2
with:
name: wiki-markdown
path: .

- name: Push wiki updates to git
run: |
git commit \
-m "Generated from GitHub "${{ github.workflow }}" Workflow" \
&& git remote set-url origin "${{ env.CLONE_URL }}" \
&& git push origin master \
|| echo "Nothing new to commit"
git add --all
git commit -m "Generated from GitHub ${{ github.workflow }} Workflow"
git push origin master || echo "Nothing new to commit"
14 changes: 0 additions & 14 deletions wiki/update-wiki.py → wiki/generate-wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
GITHUB_REPO = "unknown/rez"
GITHUB_BRANCH = "master"
GITHUB_WORKFLOW = "Wiki"
CLONE_URL = None


def add_toc(txt):
Expand Down Expand Up @@ -432,12 +431,6 @@ def __init__(self, **kwargs):
dest="workflow",
help="Name of GitHub workflow that is generating the Wiki"
)
self.add_argument(
"--wiki-url",
default=CLONE_URL,
dest="url",
help="Use this url to git clone wiki from"
)
self.add_argument(
"--out",
default=OUT_DIR,
Expand All @@ -456,22 +449,15 @@ def __init__(self, **kwargs):
raise

args = UpdateWikiParser().parse_args()
CLONE_URL = args.url
GITHUB_RELEASE = args.release
GITHUB_REPO = args.repo
GITHUB_BRANCH = args.branch
GITHUB_WORKFLOW = args.workflow
OUT_DIR = os.path.abspath(args.dir)

if not CLONE_URL:
CLONE_URL = "git@github.com:%s.wiki.git" % GITHUB_REPO

if not os.path.exists(OUT_DIR):
os.makedirs(OUT_DIR)

subprocess.check_call(
["git", "clone", "--no-checkout", CLONE_URL, OUT_DIR]
)
shutil.copytree(
os.path.join(THIS_DIR, 'media'),
os.path.join(OUT_DIR, 'media'),
Expand Down
7 changes: 0 additions & 7 deletions wiki/pages/Home.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
[[media/rez_banner_128.png]]

- [What Is Rez?](#what-is-rez)
- [The Basics](#the-basics)
- [Examples](#examples)


## What Is Rez?

Rez is a cross-platform package manager with a difference. Using Rez you can create
Expand Down