Skip to content

chore(devstate): unify repo naming and add HTTP health test #30

chore(devstate): unify repo naming and add HTTP health test

chore(devstate): unify repo naming and add HTTP health test #30

name: Go Module Publish

Check failure on line 1 in .github/workflows/go-module-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/go-module-publish.yml

Invalid workflow file

(Line: 8, Col: 3): 'push' is already defined
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>'"