chore(devstate): unify repo naming and add HTTP health test #30
This file contains hidden or 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: Go Module Publish | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - 'client-go-v*' | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'openapi.yaml' | ||
| jobs: | ||
| publish-go: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Bump Go client version | ||
| run: | | ||
| CUR=$(cat clients/go/version.txt || echo 0.1.0) | ||
| MAJ=$(echo $CUR | cut -d. -f1) | ||
| MIN=$(echo $CUR | cut -d. -f2) | ||
| NEW="$MAJ.$((MIN+1)).0" | ||
| echo $NEW > clients/go/version.txt | ||
| git config user.name "github-actions" | ||
| git config user.email "github-actions@github.com" | ||
| git add clients/go/version.txt | ||
| git commit -m "chore(go): bump version to $NEW due to OpenAPI change" || echo "No changes" | ||
| git push | ||
| git tag client-go-v$NEW | ||
| git push origin client-go-v$NEW | ||
| - name: Generate Go client | ||
| run: | | ||
| npm install -g @openapitools/openapi-generator-cli | ||
| openapi-generator-cli generate -i openapi.yaml -g go -o clients/go --additional-properties=packageName=devstate | ||
| - name: Tidy | ||
| run: | | ||
| cd clients/go && go mod tidy | ||
| - name: Push tag info | ||
| run: | | ||
| echo "Go module is published via Git tags; consumers use 'go get github.com/rustkas/devstate/clients/go@<tag>'" | ||