forked from Moddus/tldr-python-dash-docset
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (49 loc) · 1.73 KB
/
update-docset.yml
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
name: Monthly Update
on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:
env:
new_version: $(date -u +"%Y-%m-%d")
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set version number
run: sed -i "s/YYYY-MM-DD/$new_version/" static/Info.plist
- name: Build docset
run: docker compose up
create-branch:
needs: build
runs-on: ubuntu-latest
steps:
- name: Sync repo
run: gh repo sync cvn/Dash-User-Contributions -b master --force
env:
GITHUB_TOKEN: ${{ secrets.DASH_REPO_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
with:
repository: cvn/Dash-User-Contributions
token: ${{ secrets.DASH_REPO_TOKEN }}
path: Dash-User-Contributions
- name: Create brach
run: |
cd Dash-User-Contributions
git checkout -b tldr-pages-update
git push origin tldr-pages-update
- name: Check directory
run: pwd
- name: Update version number in docset.json
run: |
sed -i 's/"version": ".*"/"version": "$new_version"/' Dash-User-Contributions/docsets/tldr/docset.json
- name: Move docset
run: mv tldr_pages.tgz Dash-User-Contributions/docsets/tldr/
- name: Commit changes
run: |
cd Dash-User-Contributions
git add --all .
git commit -m "Update TLDR pages docset to $new_version"
git push