Skip to content

Commit 29d86da

Browse files
committed
feat: Initial MVP
0 parents  commit 29d86da

27 files changed

+2352
-0
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.json]
15+
indent_size = 2
16+
17+
[*.{yml,yaml}]
18+
indent_size = 2

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @philprime

.github/pre-release-template.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## 🚧 Latest Development Build
2+
3+
**This is a pre-release build from the latest `main` branch.**
4+
5+
- **Commit**: {{COMMIT_SHA}}
6+
- **Built**: {{BUILD_DATE}}
7+
- **Version**: {{VERSION}}
8+
9+
⚠️ **Warning**: This is an unstable development build. For production use, download a stable release instead.
10+
11+
### Installation
12+
13+
#### macOS
14+
15+
```bash
16+
# Apple Silicon (M1/M2/M3)
17+
curl -L -o github-actions-utils-cli https://github.com/{{REPOSITORY}}/releases/download/latest/github-actions-utils-cli-darwin-arm64
18+
chmod +x github-actions-utils-cli
19+
sudo mv github-actions-utils-cli /usr/local/bin/
20+
21+
# Intel
22+
curl -L -o github-actions-utils-cli https://github.com/{{REPOSITORY}}/releases/download/latest/github-actions-utils-cli-darwin-amd64
23+
chmod +x github-actions-utils-cli
24+
sudo mv github-actions-utils-cli /usr/local/bin/
25+
```
26+
27+
#### Linux
28+
29+
```bash
30+
# AMD64
31+
curl -L -o github-actions-utils-cli https://github.com/{{REPOSITORY}}/releases/download/latest/github-actions-utils-cli-linux-amd64
32+
chmod +x github-actions-utils-cli
33+
sudo mv github-actions-utils-cli /usr/local/bin/
34+
35+
# ARM64
36+
curl -L -o github-actions-utils-cli https://github.com/{{REPOSITORY}}/releases/download/latest/github-actions-utils-cli-linux-arm64
37+
chmod +x github-actions-utils-cli
38+
sudo mv github-actions-utils-cli /usr/local/bin/
39+
```
40+
41+
#### Windows
42+
43+
Download `github-actions-utils-cli-windows-amd64.exe` and add it to your PATH.
44+
45+
### What's New?
46+
47+
See the [commit history](https://github.com/{{REPOSITORY}}/commits/main) for recent changes.
48+
49+
### Checksums
50+
51+
See `checksums.txt` for SHA256 checksums of all binaries.

.github/release-template.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## GitHub Actions Utils CLI v{{VERSION}}
2+
3+
### Installation
4+
5+
#### macOS
6+
7+
```bash
8+
# Apple Silicon (M1/M2/M3)
9+
curl -L -o github-actions-utils-cli https://github.com/{{REPOSITORY}}/releases/download/v{{VERSION}}/github-actions-utils-cli-darwin-arm64
10+
chmod +x github-actions-utils-cli
11+
sudo mv github-actions-utils-cli /usr/local/bin/
12+
13+
# Intel
14+
curl -L -o github-actions-utils-cli https://github.com/{{REPOSITORY}}/releases/download/v{{VERSION}}/github-actions-utils-cli-darwin-amd64
15+
chmod +x github-actions-utils-cli
16+
sudo mv github-actions-utils-cli /usr/local/bin/
17+
```
18+
19+
#### Linux
20+
21+
```bash
22+
# AMD64
23+
curl -L -o github-actions-utils-cli https://github.com/{{REPOSITORY}}/releases/download/v{{VERSION}}/github-actions-utils-cli-linux-amd64
24+
chmod +x github-actions-utils-cli
25+
sudo mv github-actions-utils-cli /usr/local/bin/
26+
27+
# ARM64
28+
curl -L -o github-actions-utils-cli https://github.com/{{REPOSITORY}}/releases/download/v{{VERSION}}/github-actions-utils-cli-linux-arm64
29+
chmod +x github-actions-utils-cli
30+
sudo mv github-actions-utils-cli /usr/local/bin/
31+
```
32+
33+
#### Windows
34+
35+
Download `github-actions-utils-cli-windows-amd64.exe` and add it to your PATH.
36+
37+
### Usage
38+
39+
```bash
40+
# Run as MCP server
41+
github-actions-utils-cli mcp
42+
```
43+
44+
See the [README](https://github.com/{{REPOSITORY}}/blob/main/README.md) for more details on configuring the MCP server with Claude Desktop, Cursor, or other MCP clients.
45+
46+
### Checksums
47+
48+
See `checksums.txt` for SHA256 checksums of all binaries.

.github/workflows/analyze.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Analyze
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
analyze:
18+
name: Analyze
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v5
24+
with:
25+
persist-credentials: false
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v6
29+
with:
30+
go-version-file: go.mod
31+
cache: true
32+
check-latest: false
33+
34+
- name: Make Analyze
35+
run: make analyze
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
name: Build Binaries
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
description: "Version string to embed"
8+
required: true
9+
type: string
10+
commit_sha:
11+
description: "Commit SHA to embed"
12+
required: true
13+
type: string
14+
build_date:
15+
description: "Build date to embed"
16+
required: true
17+
type: string
18+
secrets:
19+
DEVELOPER_ID_P12_BASE64:
20+
description: "Base64-encoded Developer ID certificate"
21+
required: true
22+
DEVELOPER_ID_PASSWORD:
23+
description: "Password for the Developer ID certificate"
24+
required: true
25+
APPLE_NOTARIZATION_APPLE_ID_PASSWORD:
26+
description: "App-specific password for Apple ID notarization"
27+
required: true
28+
29+
jobs:
30+
build:
31+
name: Build ${{ matrix.platform }}
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 10
34+
strategy:
35+
matrix:
36+
include:
37+
- platform: linux-amd64
38+
goos: linux
39+
goarch: amd64
40+
- platform: linux-arm64
41+
goos: linux
42+
goarch: arm64
43+
- platform: darwin-amd64
44+
goos: darwin
45+
goarch: amd64
46+
- platform: darwin-arm64
47+
goos: darwin
48+
goarch: arm64
49+
- platform: windows-amd64
50+
goos: windows
51+
goarch: amd64
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v5
55+
with:
56+
persist-credentials: false
57+
58+
- name: Set up Go
59+
uses: actions/setup-go@v6
60+
with:
61+
go-version-file: go.mod
62+
cache: true
63+
check-latest: false
64+
65+
- name: Build CLI
66+
run: |
67+
BINARY="github-actions-utils-cli-${{ matrix.platform }}"
68+
if [ "${{ matrix.goos }}" = "windows" ]; then
69+
BINARY="${BINARY}.exe"
70+
fi
71+
72+
# Build static binary (no CGO, static linking)
73+
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \
74+
-ldflags "-s -w -extldflags '-static' \
75+
-X github.com/techprimate/github-actions-utils-cli/internal/cli/cmd.version=${{ inputs.version }} \
76+
-X github.com/techprimate/github-actions-utils-cli/internal/cli/cmd.commit=${{ inputs.commit_sha }} \
77+
-X github.com/techprimate/github-actions-utils-cli/internal/cli/cmd.date=${{ inputs.build_date }}" \
78+
-o "dist/${BINARY}" \
79+
./cmd/cli
80+
81+
- name: Upload artifact
82+
uses: actions/upload-artifact@v5
83+
with:
84+
name: cli-${{ matrix.platform }}
85+
path: dist/github-actions-utils-cli-*
86+
retention-days: 1
87+
88+
sign-and-notarize-macos:
89+
name: Sign and Notarize macOS Binaries
90+
needs: build
91+
runs-on: macos-latest
92+
timeout-minutes: 20
93+
steps:
94+
- name: Download Darwin CLI artifacts
95+
uses: actions/download-artifact@v6
96+
with:
97+
path: dist
98+
pattern: cli-darwin-*
99+
merge-multiple: true
100+
101+
- name: Setup signing certificate
102+
env:
103+
CERTIFICATE_BASE64: ${{ secrets.DEVELOPER_ID_P12_BASE64 }}
104+
CERTIFICATE_PASSWORD: ${{ secrets.DEVELOPER_ID_PASSWORD }}
105+
run: |
106+
# Create temporary keychain
107+
KEYCHAIN_NAME="github-actions-utils-signing.keychain-db"
108+
KEYCHAIN_PASSWORD=$(openssl rand -hex 32)
109+
110+
# Delete any existing keychain with the same name
111+
security delete-keychain "$KEYCHAIN_NAME" 2>/dev/null || true
112+
113+
# Create and setup keychain
114+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
115+
security set-keychain-settings -lut 21600 "$KEYCHAIN_NAME"
116+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
117+
118+
# Import certificate
119+
CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12
120+
echo "$CERTIFICATE_BASE64" | base64 --decode -o "$CERTIFICATE_PATH"
121+
security import "$CERTIFICATE_PATH" -k "$KEYCHAIN_NAME" -P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security
122+
123+
# Make keychain available for codesign
124+
security list-keychains -d user -s "$KEYCHAIN_NAME" $(security list-keychains -d user | sed s/\"//g)
125+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
126+
security default-keychain -s "$KEYCHAIN_NAME"
127+
128+
# Clean up certificate file
129+
rm -f "$CERTIFICATE_PATH"
130+
131+
# Store keychain info for cleanup
132+
echo "KEYCHAIN_NAME=$KEYCHAIN_NAME" >> $GITHUB_ENV
133+
echo "KEYCHAIN_PASSWORD=$KEYCHAIN_PASSWORD" >> $GITHUB_ENV
134+
135+
- name: Sign and notarize CLI darwin-amd64
136+
env:
137+
APPLE_ID: ${{ vars.APPLE_NOTARIZATION_APPLE_ID_USERNAME }}
138+
APPLE_ID_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_APPLE_ID_PASSWORD }}
139+
APPLE_TEAM_ID: ${{ vars.APPLE_NOTARIZATION_TEAM_ID }}
140+
SIGNING_IDENTITY: ${{ vars.APPLE_NOTARIZATION_SIGNING_IDENTITY }}
141+
run: |
142+
cd dist
143+
144+
# Sign the binary
145+
codesign --sign "$SIGNING_IDENTITY" \
146+
--options runtime \
147+
--timestamp \
148+
--force \
149+
--verbose \
150+
github-actions-utils-cli-darwin-amd64
151+
152+
# Verify signature
153+
codesign --verify --verbose github-actions-utils-cli-darwin-amd64
154+
155+
# Create zip and submit for notarization
156+
zip -q github-actions-utils-cli-darwin-amd64.zip github-actions-utils-cli-darwin-amd64
157+
xcrun notarytool submit github-actions-utils-cli-darwin-amd64.zip \
158+
--apple-id "$APPLE_ID" \
159+
--password "$APPLE_ID_PASSWORD" \
160+
--team-id "$APPLE_TEAM_ID" \
161+
--wait
162+
rm github-actions-utils-cli-darwin-amd64.zip
163+
164+
- name: Sign and notarize CLI darwin-arm64
165+
env:
166+
APPLE_ID: ${{ vars.APPLE_NOTARIZATION_APPLE_ID_USERNAME }}
167+
APPLE_ID_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_APPLE_ID_PASSWORD }}
168+
APPLE_TEAM_ID: ${{ vars.APPLE_NOTARIZATION_TEAM_ID }}
169+
SIGNING_IDENTITY: ${{ vars.APPLE_NOTARIZATION_SIGNING_IDENTITY }}
170+
run: |
171+
cd dist
172+
173+
# Sign the binary
174+
codesign --sign "$SIGNING_IDENTITY" \
175+
--options runtime \
176+
--timestamp \
177+
--force \
178+
--verbose \
179+
github-actions-utils-cli-darwin-arm64
180+
181+
# Verify signature
182+
codesign --verify --verbose github-actions-utils-cli-darwin-arm64
183+
184+
# Create zip and submit for notarization
185+
zip -q github-actions-utils-cli-darwin-arm64.zip github-actions-utils-cli-darwin-arm64
186+
xcrun notarytool submit github-actions-utils-cli-darwin-arm64.zip \
187+
--apple-id "$APPLE_ID" \
188+
--password "$APPLE_ID_PASSWORD" \
189+
--team-id "$APPLE_TEAM_ID" \
190+
--wait
191+
rm github-actions-utils-cli-darwin-arm64.zip
192+
193+
- name: Cleanup keychain
194+
if: always()
195+
run: |
196+
if [ -n "$KEYCHAIN_NAME" ]; then
197+
security delete-keychain "$KEYCHAIN_NAME" || true
198+
fi
199+
200+
- name: Upload signed CLI darwin-amd64
201+
uses: actions/upload-artifact@v5
202+
with:
203+
name: cli-darwin-amd64
204+
path: dist/github-actions-utils-cli-darwin-amd64
205+
retention-days: 1
206+
overwrite: true
207+
208+
- name: Upload signed CLI darwin-arm64
209+
uses: actions/upload-artifact@v5
210+
with:
211+
name: cli-darwin-arm64
212+
path: dist/github-actions-utils-cli-darwin-arm64
213+
retention-days: 1
214+
overwrite: true

0 commit comments

Comments
 (0)