Skip to content

Merge pull request #43 from latitudesh/fix/documentation-release-ghac… #11

Merge pull request #43 from latitudesh/fix/documentation-release-ghac…

Merge pull request #43 from latitudesh/fix/documentation-release-ghac… #11

Workflow file for this run

# 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.21.6'
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
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.21.6'
-
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