Skip to content

Commit 5dbdd1f

Browse files
committed
feat: add Release-Please configuration for taco CLI and statesman
- Add Release-Please manifest mode configuration - Add GitHub Actions workflows for automated releases - Add multi-platform binary builds for CLI and Statesman - Add Docker container builds for Statesman service - Update .gitignore to exclude build artifacts - Add version tracking for all components
1 parent 658ef3d commit 5dbdd1f

File tree

7 files changed

+277
-1
lines changed

7 files changed

+277
-1
lines changed

.github/release-please-config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"bootstrap-sha": "",
3+
"group-pull-request-title-pattern": "chore: release {{version}} (multi-module)",
4+
"plugins": ["node-workspace"],
5+
"release-type": "go"
6+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: google-github-actions/release-please-action@v4
16+
with:
17+
command: manifest
18+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/taco-release.yml

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: taco-release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'taco/cmd/taco/v*'
7+
- 'taco/cmd/statesman/v*'
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
include:
19+
- os: linux
20+
arch: amd64
21+
goos: linux
22+
goarch: amd64
23+
- os: linux
24+
arch: arm64
25+
goos: linux
26+
goarch: arm64
27+
- os: darwin
28+
arch: amd64
29+
goos: darwin
30+
goarch: amd64
31+
- os: darwin
32+
arch: arm64
33+
goos: darwin
34+
goarch: arm64
35+
- os: windows
36+
arch: amd64
37+
goos: windows
38+
goarch: amd64
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
44+
- uses: actions/setup-go@v5
45+
with:
46+
go-version: '1.24'
47+
48+
- name: Derive app dir and version
49+
id: meta
50+
run: |
51+
TAG="${GITHUB_REF_NAME}" # e.g. taco/cli/v1.2.3
52+
APP_DIR="${TAG%/v*}" # taco/cli
53+
VERSION="${TAG##*/}" # v1.2.3
54+
echo "app_dir=$APP_DIR" >> $GITHUB_OUTPUT
55+
echo "version=$VERSION" >> $GITHUB_OUTPUT
56+
57+
- name: Build CLI
58+
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/taco')
59+
working-directory: taco/cmd/taco
60+
run: |
61+
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \
62+
-ldflags="-X 'main.Version=${{ steps.meta.outputs.version }}' -X 'main.Commit=${{ github.sha }}' -s -w" \
63+
-o taco-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }} .
64+
65+
- name: Build Statesman
66+
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/statesman')
67+
working-directory: taco/cmd/statesman
68+
run: |
69+
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \
70+
-ldflags="-X 'main.Version=${{ steps.meta.outputs.version }}' -X 'main.Commit=${{ github.sha }}' -s -w" \
71+
-o statesman-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }} .
72+
73+
- name: Upload CLI artifacts
74+
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/taco')
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: taco-cli-${{ matrix.os }}-${{ matrix.arch }}
78+
path: taco/cmd/taco/taco-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }}
79+
80+
- name: Upload Statesman artifacts
81+
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/statesman')
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: taco-statesman-${{ matrix.os }}-${{ matrix.arch }}
85+
path: taco/cmd/statesman/statesman-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }}
86+
87+
build-docker:
88+
if: startsWith(github.ref_name, 'taco/cmd/statesman/')
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v4
92+
with:
93+
fetch-depth: 0
94+
95+
- uses: actions/setup-go@v5
96+
with:
97+
go-version: '1.24'
98+
99+
- name: Derive version
100+
id: meta
101+
run: |
102+
TAG="${GITHUB_REF_NAME}" # e.g. taco/statesman/v1.2.3
103+
VERSION="${TAG##*/}" # v1.2.3
104+
echo "version=$VERSION" >> $GITHUB_OUTPUT
105+
106+
- name: Set up Docker Buildx
107+
uses: docker/setup-buildx-action@v3
108+
109+
- name: Log in to Container Registry
110+
uses: docker/login-action@v3
111+
with:
112+
registry: ghcr.io
113+
username: ${{ github.actor }}
114+
password: ${{ secrets.GITHUB_TOKEN }}
115+
116+
- name: Extract metadata
117+
id: docker-meta
118+
uses: docker/metadata-action@v5
119+
with:
120+
images: ghcr.io/${{ github.repository }}/taco-statesman
121+
tags: |
122+
type=ref,event=tag
123+
type=semver,pattern={{version}}
124+
type=semver,pattern={{major}}.{{minor}}
125+
type=raw,value=latest,enable={{is_default_branch}}
126+
127+
- name: Build and push Docker image
128+
uses: docker/build-push-action@v5
129+
with:
130+
context: ./taco
131+
file: ./taco/Dockerfile_statesman
132+
push: true
133+
tags: ${{ steps.docker-meta.outputs.tags }}
134+
labels: ${{ steps.docker-meta.outputs.labels }}
135+
build-args: |
136+
COMMIT_SHA=${{ github.sha }}
137+
VERSION=${{ steps.meta.outputs.version }}
138+
139+
create-release:
140+
needs: [build, build-docker]
141+
runs-on: ubuntu-latest
142+
steps:
143+
- uses: actions/checkout@v4
144+
with:
145+
fetch-depth: 0
146+
147+
- name: Derive app dir and version
148+
id: meta
149+
run: |
150+
TAG="${GITHUB_REF_NAME}" # e.g. taco/cli/v1.2.3
151+
APP_DIR="${TAG%/v*}" # taco/cli
152+
VERSION="${TAG##*/}" # v1.2.3
153+
echo "app_dir=$APP_DIR" >> $GITHUB_OUTPUT
154+
echo "version=$VERSION" >> $GITHUB_OUTPUT
155+
156+
- name: Download all artifacts
157+
uses: actions/download-artifact@v4
158+
159+
- name: Create release for CLI
160+
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/taco')
161+
uses: softprops/action-gh-release@v1
162+
with:
163+
tag_name: ${{ github.ref_name }}
164+
name: Taco CLI ${{ steps.meta.outputs.version }}
165+
body: |
166+
## Taco CLI ${{ steps.meta.outputs.version }}
167+
168+
### Downloads
169+
- **Linux AMD64**: [taco-linux-amd64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/taco-linux-amd64)
170+
- **Linux ARM64**: [taco-linux-arm64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/taco-linux-arm64)
171+
- **macOS AMD64**: [taco-darwin-amd64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/taco-darwin-amd64)
172+
- **macOS ARM64**: [taco-darwin-arm64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/taco-darwin-arm64)
173+
- **Windows AMD64**: [taco-windows-amd64.exe](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/taco-windows-amd64.exe)
174+
175+
### Installation
176+
Download the appropriate binary for your platform and make it executable:
177+
```bash
178+
chmod +x taco-<platform>-<arch>
179+
sudo mv taco-<platform>-<arch> /usr/local/bin/taco
180+
```
181+
files: |
182+
taco-cli-*/taco-*
183+
draft: false
184+
prerelease: false
185+
186+
- name: Create release for Statesman
187+
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/statesman')
188+
uses: softprops/action-gh-release@v1
189+
with:
190+
tag_name: ${{ github.ref_name }}
191+
name: Taco Statesman ${{ steps.meta.outputs.version }}
192+
body: |
193+
## Taco Statesman ${{ steps.meta.outputs.version }}
194+
195+
### Downloads
196+
- **Linux AMD64**: [statesman-linux-amd64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/statesman-linux-amd64)
197+
- **Linux ARM64**: [statesman-linux-arm64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/statesman-linux-arm64)
198+
- **macOS AMD64**: [statesman-darwin-amd64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/statesman-darwin-amd64)
199+
- **macOS ARM64**: [statesman-darwin-arm64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/statesman-darwin-arm64)
200+
- **Windows AMD64**: [statesman-windows-amd64.exe](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/statesman-windows-amd64.exe)
201+
202+
### Docker
203+
```bash
204+
docker pull ghcr.io/${{ github.repository }}/taco-statesman:${{ steps.meta.outputs.version }}
205+
```
206+
207+
### Installation
208+
Download the appropriate binary for your platform and make it executable:
209+
```bash
210+
chmod +x statesman-<platform>-<arch>
211+
sudo mv statesman-<platform>-<arch> /usr/local/bin/statesman
212+
```
213+
files: |
214+
taco-statesman-*/statesman-*
215+
draft: false
216+
prerelease: false

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,29 @@
66
venv/
77
**/__pycache__/
88
__azurite*
9+
10+
# Go binaries and build artifacts
11+
*.exe
12+
*.exe~
13+
*.dll
14+
*.so
15+
*.dylib
16+
*.test
17+
*.out
18+
go.work.sum
19+
20+
# Taco specific binaries
21+
taco
22+
statesman
23+
terraform-provider-opentaco
24+
opentacosvc
25+
26+
# Build directories
27+
dist/
28+
build/
29+
bin/
30+
31+
# IDE and editor files
32+
*.swp
33+
*.swo
34+
*~

backend/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
DEFAULT
1+
0.0.0

go.work

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ use (
1313

1414
./libs
1515

16+
./taco/cmd/statesman
17+
./taco/cmd/taco
18+
./taco/internal
19+
./taco/pkg/sdk
20+
1621
)

release-please-manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"backend": "0.0.0",
3+
"taco/cmd/taco": "0.0.0",
4+
"taco/cmd/statesman": "0.0.0"
5+
}

0 commit comments

Comments
 (0)