From 50c6be783b409de86fafcd76d59479cc851a5514 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Thu, 22 Jan 2026 23:07:57 +0200 Subject: [PATCH] docs: add README.md --- .prettierrc | 15 +++++++++++ README.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 .prettierrc create mode 100644 README.md diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..548c817 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,15 @@ +{ + "printWidth": 100, + "semi": false, + "singleQuote": true, + "trailingComma": "all", + "overrides": [ + { + "files": "*.md", + "options": { + "printWidth": 100, + "proseWrap": "always" + } + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..80d2a72 --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +# Reusable GitHub Workflows + +A collection of reusable GitHub Actions workflows. + +## Workflows + +### Go Release (`go-release.yml`) + +A complete CI/CD workflow for Go projects that handles testing, cross-platform builds, releases, and +Homebrew tap updates. + +#### Features + +- Runs tests with configurable test command +- Cross-platform builds (Linux, macOS, Windows) +- Automated releases via [release-please](https://github.com/googleapis/release-please) +- Automatic Homebrew tap updates via repository dispatch + +#### Usage + +```yaml +name: Release + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + release: + uses: chenasraf/workflows/.github/workflows/go-release.yml@main + with: + name: my-binary + secrets: + REPO_DISPATCH_PAT: ${{ secrets.REPO_DISPATCH_PAT }} +``` + +#### Inputs + +| Input | Description | Required | Default | +| ------------------- | ---------------------------------------------------- | -------- | ------------------------------------------------------------------ | +| `name` | Binary/project name | Yes | - | +| `go-version` | Go version to use | No | `1.24` | +| `platforms` | JSON array of platforms to build | No | `["linux/amd64", "darwin/amd64", "darwin/arm64", "windows/amd64"]` | +| `package` | Go package path (empty for root) | No | `""` | +| `compress` | Compress build artifacts | No | `true` | +| `test-command` | Test command to run | No | `go test -v ./...` | +| `skip-tests` | Skip running tests | No | `false` | +| `main-branch` | Main branch name for releases | No | `master` | +| `homebrew-tap-repo` | Homebrew tap repo for dispatch (leave empty to skip) | No | `chenasraf/homebrew-tap` | + +#### Secrets + +| Secret | Description | Required | +| ------------------- | ---------------------------------------- | -------- | +| `REPO_DISPATCH_PAT` | PAT for dispatching to homebrew tap repo | No | + +#### Example with Custom Options + +```yaml +jobs: + release: + uses: chenasraf/workflows/.github/workflows/go-release.yml@master + with: + name: my-cli + go-version: '1.24' + platforms: '["linux/amd64", "darwin/arm64"]' + main-branch: main + homebrew-tap-repo: myorg/homebrew-tap + secrets: + REPO_DISPATCH_PAT: ${{ secrets.REPO_DISPATCH_PAT }} +```