Skip to content

changes to readme.md #15

changes to readme.md

changes to readme.md #15

name: Generate and Release NEAR RPC Client
on:
workflow_dispatch:
push:
schedule:
- cron: "0 0 * * 0" # weekly run (every Sunday at midnight)
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: true
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 21
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Run Generator
run: ./gradlew :generator:run --no-daemon
- name: Build project
run: ./gradlew build --stacktrace --no-daemon
- name: Commit regenerated sources (if any) and push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# determine current branch (works for workflow_dispatch and scheduled runs)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "On branch: $BRANCH"
git add .
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: regenerate client from OpenAPI"
git push origin "$BRANCH"
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v0.1.0
name: "NEAR RPC Client v0.1.0"
body: "Auto-generated client from the latest OpenAPI spec. Includes updated models and client code."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}