Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |