forked from AcademySoftwareFoundation/rez
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 1.86 KB
/
wiki.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: wiki
on:
release:
types: [released]
push:
paths:
- '.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:
name: Build Wiki Artifact
runs-on: ubuntu-latest
env:
TEMP_WIKI_DIR: "wiki/.rez-gen-wiki-tmp"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # required to generate credits list
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Build Wiki
working-directory: wiki
run: |
rezver=$(cat ./src/rez/utils/_version.py | grep -w _rez_version | tr '"' ' ' | awk '{print $NF}')
python update-wiki.py \
--keep-temp \
--no-push \
--github-release=${rezver} \
--wiki-dir="${{ github.workspace }}"/"${{ env.TEMP_WIKI_DIR }}" \
--wiki-url="${{ env.CLONE_URL }}"
- uses: actions/upload-artifact@v2
with:
name: wiki-markdown
path: ${{ env.TEMP_WIKI_DIR }}
publish:
name: Publish to GitHub Wiki
runs-on: ubuntu-latest
needs: build
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
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"