Follow Up #49
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: Follow Up | |
on: | |
workflow_dispatch: | |
inputs: | |
run-id: | |
description: docs page GHA run id | |
required: true | |
type: number | |
jobs: | |
follow-up: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: github-pages | |
path: unofficial-documentation | |
repository: solvedac/unofficial-documentation | |
github-token: ${{ secrets.PAT_FOLLOW_UP }} | |
run-id: ${{ github.event.inputs.run-id }} | |
- run: tar -xf artifact.tar ./tsp-output/@typespec/openapi3/openapi.yaml | |
working-directory: unofficial-documentation | |
- run: ls -R | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- uses: actions/setup-node@v4 | |
- name: Generate | |
run: npx @openapitools/openapi-generator-cli batch --clean rust.yaml | |
- name: Update Version | |
run: | | |
sed --version && | |
file=unofficial-documentation/tsp-output/@typespec/openapi3/openapi.yaml && | |
cat $file | head -n10 && | |
version=$(sed -rn 's/\s+version:\s*"([^"]+)"/\1/p' $file | sed -rn 's/\.0+([0-9]+)/.\1/p') && | |
echo New Version: $version && | |
sed -ri ":a;N;\$!ba;s/\"solvedac_api\"\nversion = \"[^\"]+\"/\"solvedac_api\"\nversion = \"$version\"/" Cargo.toml | |
- name: Move Generated Files | |
run: | | |
rm -rf src; | |
mv generated/src -t .; | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Follow-up solvedac/unofficial-documentation | |
title: Follow-up solvedac/unofficial-documentation | |
body: | | |
This Pull Request will update the sources based on upstream docs. | |
It is automatically created by GitHub Actions. | |
labels: follow-up |