Skip to content

Commit 3715cd3

Browse files
Add CI/CD workflows and GoReleaser configuration
- Add GitHub Actions workflows (test, release, draft_release) - Add GoReleaser config for cross-platform builds - Add CLAUDE.md for future AI development assistance - Fix Go version in go.mod (1.25.5 → 1.23.0) Workflows include: - Automated testing on push/PR (Linux, macOS, Windows) - Release automation with GoReleaser on version tags - Draft release workflow for testing releases 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 450032b commit 3715cd3

9 files changed

Lines changed: 461 additions & 1 deletion

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve Sky CLI
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of the bug.
12+
13+
## Steps to Reproduce
14+
15+
1. Run command: `sky ...`
16+
2. With flags: `--format ...`
17+
3. Expected: ...
18+
4. Actual: ...
19+
20+
## Environment
21+
22+
- **OS**: [e.g., macOS 14.0, Ubuntu 22.04, Windows 11]
23+
- **Architecture**: [e.g., x86_64, arm64]
24+
- **Sky CLI Version**: [run `sky version`]
25+
- **Go Version**: [run `go version` if building from source]
26+
27+
## Command Output
28+
29+
```
30+
Paste the full command output here
31+
```
32+
33+
## Expected Behavior
34+
35+
What should have happened.
36+
37+
## Actual Behavior
38+
39+
What actually happened.
40+
41+
## Additional Context
42+
43+
Any additional information, screenshots, or configuration files that might help.
44+
45+
## Configuration
46+
47+
If relevant, share your `~/.sky/config.yaml`:
48+
49+
```yaml
50+
# Paste relevant config here (remove sensitive data)
51+
```
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement for Sky CLI
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Use Case
14+
15+
Describe the problem this feature would solve or the workflow it would improve.
16+
17+
**Example scenario:**
18+
As a user, I want to [do something] so that [achieve goal].
19+
20+
## Proposed Solution
21+
22+
Describe how you envision this feature working.
23+
24+
**Example:**
25+
26+
```bash
27+
sky [new-command] --option value
28+
```
29+
30+
## Alternatives Considered
31+
32+
Have you considered any alternative solutions or workarounds?
33+
34+
## Additional Context
35+
36+
Any additional information, mockups, or examples from other tools.
37+
38+
## Implementation Ideas
39+
40+
If you have ideas about how this could be implemented, share them here (optional).

‎.github/pull_request_template.md‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Pull Request
2+
3+
## Description
4+
5+
Brief description of changes.
6+
7+
## Type of Change
8+
9+
- [ ] Bug fix (non-breaking change that fixes an issue)
10+
- [ ] New feature (non-breaking change that adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
12+
- [ ] Documentation update
13+
- [ ] Performance improvement
14+
- [ ] Code refactoring
15+
- [ ] CI/CD changes
16+
17+
## Changes Made
18+
19+
- Change 1
20+
- Change 2
21+
- Change 3
22+
23+
## Testing
24+
25+
- [ ] Unit tests added/updated
26+
- [ ] All tests pass locally (`go test ./...`)
27+
- [ ] Tested on multiple platforms (if applicable)
28+
- [ ] Manual testing completed
29+
30+
**Test commands:**
31+
32+
```bash
33+
# Commands used to test
34+
```
35+
36+
## Checklist
37+
38+
- [ ] Code follows the project's style guidelines
39+
- [ ] Self-review of code completed
40+
- [ ] Comments added for complex logic
41+
- [ ] Documentation updated (if needed)
42+
- [ ] No new warnings or errors introduced
43+
- [ ] Related issues linked
44+
45+
## Related Issues
46+
47+
Fixes #(issue number)
48+
Relates to #(issue number)
49+
50+
## Screenshots (if applicable)
51+
52+
Add screenshots or terminal output if relevant.
53+
54+
## Additional Notes
55+
56+
Any additional information for reviewers.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Draft Release (Test)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to test (e.g., v0.4.0-rc.1)"
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
test:
16+
name: Test before draft release
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: "1.23.x"
28+
cache: true
29+
30+
- name: Run tests
31+
run: go test -v ./...
32+
33+
- name: Run linters
34+
run: |
35+
gofmt -s -l .
36+
go vet ./...
37+
go mod verify
38+
39+
draft-release:
40+
name: Create Draft Release
41+
needs: test
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0
48+
49+
- name: Set up Go
50+
uses: actions/setup-go@v5
51+
with:
52+
go-version: "1.23.x"
53+
cache: true
54+
55+
- name: Create and push tag
56+
run: |
57+
git config user.name "github-actions[bot]"
58+
git config user.email "github-actions[bot]@users.noreply.github.com"
59+
git tag -a ${{ inputs.version }} -m "Draft release ${{ inputs.version }}"
60+
git push origin ${{ inputs.version }}
61+
62+
- name: Run GoReleaser (Snapshot)
63+
uses: goreleaser/goreleaser-action@v6
64+
with:
65+
distribution: goreleaser
66+
version: "~> v2"
67+
args: release --clean
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Comment on draft
72+
run: |
73+
echo "Draft release created! Review at: https://github.com/${{ github.repository }}/releases/tag/${{ inputs.version }}"
74+
echo "If everything looks good, publish the release manually or delete and create a proper release tag."

‎.github/workflows/release.yml‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
test:
13+
name: Test before release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: "1.23.x"
25+
cache: true
26+
27+
- name: Run tests
28+
run: go test -v ./...
29+
30+
release:
31+
name: Create Release
32+
needs: test
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Set up Go
41+
uses: actions/setup-go@v5
42+
with:
43+
go-version: "1.23.x"
44+
cache: true
45+
46+
- name: Run GoReleaser
47+
uses: goreleaser/goreleaser-action@v6
48+
with:
49+
distribution: goreleaser
50+
version: "~> v2"
51+
args: release --clean
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/test.yml‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "feat-*"
8+
- "fix-*"
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: "1.23.x"
25+
cache: true
26+
27+
- name: Check formatting
28+
run: |
29+
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
30+
echo "The following files are not formatted:"
31+
gofmt -s -l .
32+
exit 1
33+
fi
34+
35+
- name: Run go vet
36+
run: go vet ./...
37+
38+
- name: Run go mod verify
39+
run: go mod verify
40+
41+
test:
42+
name: Test
43+
runs-on: ${{ matrix.os }}
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
os: [ubuntu-latest, macos-latest, windows-latest]
48+
go: ["1.23.x", "1.22.x"]
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Set up Go
55+
uses: actions/setup-go@v5
56+
with:
57+
go-version: ${{ matrix.go }}
58+
cache: true
59+
60+
- name: Download dependencies
61+
run: go mod download
62+
63+
- name: Run tests (Unix)
64+
if: runner.os != 'Windows'
65+
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
66+
67+
- name: Run tests (Windows)
68+
if: runner.os == 'Windows'
69+
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
70+
shell: bash
71+
72+
- name: Upload coverage to Codecov
73+
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.23.x'
74+
uses: codecov/codecov-action@v4
75+
with:
76+
file: ./coverage.txt
77+
fail_ci_if_error: false
78+
token: ${{ secrets.CODECOV_TOKEN }}
79+
80+
build:
81+
name: Build
82+
runs-on: ubuntu-latest
83+
needs: [lint, test]
84+
steps:
85+
- name: Checkout code
86+
uses: actions/checkout@v4
87+
88+
- name: Set up Go
89+
uses: actions/setup-go@v5
90+
with:
91+
go-version: "1.23.x"
92+
cache: true
93+
94+
- name: Build binary
95+
run: go build -v -o tibber ./cmd/tibber
96+
97+
- name: Test binary
98+
run: ./tibber --help

0 commit comments

Comments
 (0)