Generate Protocol Specification #634
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: "Generate Protocol Specification" | |
on: | |
push: | |
branches: [ "main" ] | |
tags-ignore: [ "**" ] | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
generate: | |
name: "Generate Protocol Specification" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
check-latest: true | |
distribution: 'zulu' | |
cache: 'gradle' | |
- name: Build Generator | |
run: ./gradlew clean build shadowJar | |
- name: Prepare execute directory | |
run: | | |
mkdir -p generation/; | |
mkdir -p generation/result/; | |
cp -r pages/* generation/result/; | |
cp build/libs/protocol-generator.jar generation/generator.jar; | |
- name: Run generator | |
run: | | |
cd generation; | |
java -jar generator.jar --output-file=result/readme.md --version-file=version.txt; | |
- name: Export processed version to env | |
run: | | |
cd generation; | |
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV; | |
- name: Push and Tag generated specification | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: gh-pages | |
FOLDER: generation/result | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SKIP_EMPTY_COMMITS: true | |
MESSAGE: Update protocol for ${{ env.VERSION }} | |
TAG: ${{ env.VERSION }} |