-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.83 KB
/
update-version.yml
File metadata and controls
53 lines (47 loc) · 1.83 KB
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: Update README with Latest Version
on:
release:
types: [published]
permissions:
contents: write
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get Release Tag Name
id: get_tag_name
run: echo "RELEASE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Update installation.md in wiki
run: |
LATEST_VERSION=${{ env.RELEASE_TAG }}
# Replace the version string in the Gradle dependency line
sed -i "s/de\.derioo\.javautils:\[subproject\]:[0-9]*\.[0-9]*\.[0-9]*/de.derioo.javautils:[subproject]:${LATEST_VERSION}/g" .github/wiki/installation.md
# Replace the version string in the Maven dependency line
sed -i "s/<version>[0-9]*\.[0-9]*\.[0-9]*((-[A-z]*){0,1})<\/version>/<version>${LATEST_VERSION}<\/version>/g" .github/wiki/installation.md
cat .github/wiki/installation.md
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git checkout -b update-readme-with-latest-version
git add .
git commit -m "Update installation wiki file with latest version ${{ env.RELEASE_TAG }}"
git push --force origin update-readme-with-latest-version:main
sync-files:
needs: update-readme
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Run GitHub File Sync
uses: "knerio/GithubSyncFilesAction@main"
wiki:
needs: sync-files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: spenserblack/actions-wiki@main