Merge pull request #66 from latitudesh/fix/missing-render-file #33
Workflow file for this run
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
| # This workflow will build a golang project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
| name: release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - | |
| name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.22.0' | |
| - | |
| name: Remove conflicting go.mod | |
| run: | | |
| # Remove cmd/lsh/go.mod as it conflicts with root go.mod | |
| rm -f cmd/lsh/go.mod | |
| - | |
| name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v5 | |
| with: | |
| distribution: goreleaser | |
| version: 'v1.26.2' | |
| args: release --clean --config .goreleaser.yaml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }} | |
| generate-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - | |
| name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.22.0' | |
| - | |
| name: Remove conflicting go.mod | |
| run: | | |
| # Remove cmd/lsh/go.mod as it conflicts with root go.mod | |
| rm -f cmd/lsh/go.mod | |
| - | |
| name: Generate documentation | |
| run: go run internal/generator/documentation/generate.go | |
| - | |
| name: Sync to readme | |
| run: | | |
| docs=$( jq -sR '{"body": .}' commands.md ) | |
| curl --request PUT \ | |
| --url https://dash.readme.com/api/v1/docs/cli-commands \ | |
| --header 'accept: application/json' \ | |
| --header 'authorization: Basic ${{ secrets.README_API_KEY }}' \ | |
| --header 'content-type: application/json' \ | |
| --data $docs |