Skip to content

Commit 2829b89

Browse files
authored
Merge pull request #2143 from diggerhq/feat/breardon2011/taco-release-pipeline-clean
Taco Release Pipeline
2 parents 658ef3d + e80d8bf commit 2829b89

File tree

28 files changed

+608
-417
lines changed

28 files changed

+608
-417
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches: [develop]
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 }}
19+
config-file: .github/release-please-config.json
20+
manifest-file: .release-please-manifest.json

.github/workflows/taco-release.yml

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

.release-please-manifest.json

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

backend/go.mod

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,30 +80,30 @@ require (
8080
github.com/armon/go-metrics v0.4.1 // indirect
8181
github.com/armon/go-radix v1.0.0 // indirect
8282
github.com/aws/aws-sdk-go v1.51.21 // indirect
83-
github.com/aws/aws-sdk-go-v2 v1.32.4 // indirect
84-
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
85-
github.com/aws/aws-sdk-go-v2/config v1.28.3 // indirect
86-
github.com/aws/aws-sdk-go-v2/credentials v1.17.44 // indirect
83+
github.com/aws/aws-sdk-go-v2 v1.38.1 // indirect
84+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 // indirect
85+
github.com/aws/aws-sdk-go-v2/config v1.31.2 // indirect
86+
github.com/aws/aws-sdk-go-v2/credentials v1.18.6 // indirect
8787
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.15 // indirect
8888
github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.7.50 // indirect
89-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 // indirect
90-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 // indirect
91-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 // indirect
92-
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
93-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.23 // indirect
89+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.4 // indirect
90+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.4 // indirect
91+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.4 // indirect
92+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
93+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.4 // indirect
9494
github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.27.5 // indirect
9595
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.36.5 // indirect
9696
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.24.5 // indirect
97-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
98-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.4 // indirect
97+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 // indirect
98+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.4 // indirect
9999
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.4 // indirect
100-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4 // indirect
101-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.4 // indirect
102-
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.3 // indirect
103-
github.com/aws/aws-sdk-go-v2/service/sso v1.24.5 // indirect
104-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4 // indirect
105-
github.com/aws/aws-sdk-go-v2/service/sts v1.32.4 // indirect
106-
github.com/aws/smithy-go v1.22.0 // indirect
100+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.4 // indirect
101+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.4 // indirect
102+
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.1 // indirect
103+
github.com/aws/aws-sdk-go-v2/service/sso v1.28.2 // indirect
104+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.33.2 // indirect
105+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.0 // indirect
106+
github.com/aws/smithy-go v1.22.5 // indirect
107107
github.com/beorn7/perks v1.0.1 // indirect
108108
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
109109
github.com/blang/semver v3.5.1+incompatible // indirect
@@ -143,7 +143,7 @@ require (
143143
github.com/gobwas/glob v0.2.3 // indirect
144144
github.com/goccy/go-json v0.10.3 // indirect
145145
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
146-
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
146+
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
147147
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
148148
github.com/golang-sql/sqlexp v0.1.0 // indirect
149149
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect

0 commit comments

Comments
 (0)