Skip to content

Automatically Update README.md for Updates #9

@CJCrafter

Description

@CJCrafter

In the below text, the 1.0.0 quickly falls out of date. It needs to be updated every release.


For Gradle projects, add this to your build.gradle file in the dependencies block:

dependencies {
    implementation 'com.cjcrafter:openai:1.0.0'
}

Or, if you are using Kotlin DSL (build.gradle.kts), add this to your dependencies block:

dependencies {
    implementation("com.cjcrafter:openai:1.0.0")
}

For Maven projects, add this to your pom.xml file in the <dependencies> block:

<dependency>
    <groupId>com.cjcrafter</groupId>
    <artifactId>openai</artifactId>
    <version>1.0.0</version>
</dependency>

See the maven repository for gradle/ant/etc.


Use a GitHub action like this:

name: Update README Version

on:
  release:
    types:
      - published

jobs:
  update-version:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Update version in README
        run: |
          VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///g')
          sed -i "s/com.cjcrafter:openai:[0-9]*\.[0-9]*\.[0-9]*/com.cjcrafter:openai:$VERSION/g" README.md

      - name: Commit and push changes
        run: |
          git config --global user.name "GitHub Actions Bot"
          git config --global user.email "<your-email>"
          git add README.md
          git commit -m "Update version in README.md"
          git push

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions