-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (60 loc) · 2.17 KB
/
sync-readme.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
54
55
56
57
58
59
60
61
62
63
64
65
name: '📚 Sync mod.io README and Images'
on:
workflow_dispatch:
repository_dispatch:
types: [ sync-readme ]
jobs:
sync_modio:
runs-on: ubuntu-latest
name: 'Sync mod.io README and Images'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get README
id: get-readme
run: |
result=$(pwsh ./src/get-version-table.ps1 -ProjectFilePath "./src/jcdcdev.Eco.Core.csproj" -PackageId "jcdcdev.Eco.Core")
{
echo 'result<<EOF'
echo "${result}"
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@v4
- name: Update README
shell: pwsh
run: |
$result = "${{ steps.get-readme.outputs.result }}"
git config user.name "$env:GITHUB_ACTOR"
git config user.email "$env:GITHUB_ACTOR_ID+$env:[email protected]"
$readme = Get-Content -Path ".github/README.md" -Raw
$regex = '(## Version Table[\S\s]*)'
$newReadme = $readme -replace $regex, "## Version Table`n$result"
Write-Host "new readme=$newReadme"
if ($newReadme -eq $readme) {
Write-Host "No changes to README"
exit 0
}
Set-Content -Path ".github/README.md" -Value $newReadme
git add .github/README.md
git commit -m "doc: Update version table"
git push origin
- name: Sync with mod.io
uses: jcdcdev/jcdcdev.Github.ModioSyncDocs@main
with:
logo-path: "docs/logo.png"
images-path: "docs/screenshots"
readme-path: ".github/README.md"
project-author: "JCDC DEV"
project-name: "CORE"
imejis-generate-image: true
imejis-design-id: "${{ secrets.DESIGN_ID }}"
imejis-key: "${{ secrets.IMEJIS_KEY }}"
modio-game: "${{ secrets.MODIO_GAME }}"
modio-mod: "${{ secrets.MODIO_MOD }}"
modio-token: "${{ secrets.MODIO_TOKEN }}"