tapes
Package main provides reproducible builds and tests locally and in GitHub actions.It is the main harness for handling nearly all dev operations.
Installation
dagger install github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8Entrypoint
Return Type
Tapes !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Project source directory. |
Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
func (m *MyModule) Example() *dagger.Tapes {
return dag.
Tapes()
}@function
def example() -> dagger.Tapes:
return (
dag.tapes()
)@func()
example(): Tapes {
return dag
.tapes()
}Types
Tapes 🔗
Tapes is the main module for the Tapes CI/CD pipeline
checkGoModTidy() 🔗
CheckGoModTidy runs “go mod tidy” and fails if it produces any changes to go.mod or go.sum, indicating that the caller forgot to tidy before committing.
Return Type
String ! Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
check-go-mod-tidyfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Tapes().
CheckGoModTidy(ctx)
}@function
async def example() -> str:
return await (
dag.tapes()
.check_go_mod_tidy()
)@func()
async example(): Promise<string> {
return dag
.tapes()
.checkGoModTidy()
}releaseLatest() 🔗
Release builds release binaries and uploads to bucket
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String ! | - | Version string (e.g., "v1.0.0") |
| commit | String ! | - | Git commit SHA |
| endpoint | Secret ! | - | Bucket endpoint URL |
| bucket | Secret ! | - | Bucket name |
| accessKeyId | Secret ! | - | Bucket access key ID |
| secretAccessKey | Secret ! | - | Bucket secret access key |
Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
release-latest --version string --commit string --endpoint env:MYSECRET --bucket env:MYSECRET --access-key-id env:MYSECRET --secret-access-key env:MYSECRETfunc (m *MyModule) Example(version string, commit string, endpoint *dagger.Secret, bucket *dagger.Secret, accessKeyId *dagger.Secret, secretAccessKey *dagger.Secret) *dagger.Directory {
return dag.
Tapes().
ReleaseLatest(version, commit, endpoint, bucket, accessKeyId, secretAccessKey)
}@function
def example(version: str, commit: str, endpoint: dagger.Secret, bucket: dagger.Secret, access_key_id: dagger.Secret, secret_access_key: dagger.Secret) -> dagger.Directory:
return (
dag.tapes()
.release_latest(version, commit, endpoint, bucket, access_key_id, secret_access_key)
)@func()
example(version: string, commit: string, endpoint: Secret, bucket: Secret, accessKeyId: Secret, secretAccessKey: Secret): Directory {
return dag
.tapes()
.releaseLatest(version, commit, endpoint, bucket, accessKeyId, secretAccessKey)
}nightly() 🔗
Nightly builds and uploads nightly artifacts
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| commit | String ! | - | Git commit SHA |
| endpoint | Secret ! | - | Bucket endpoint URL |
| bucket | Secret ! | - | Bucket name |
| accessKeyId | Secret ! | - | Bucket access key ID |
| secretAccessKey | Secret ! | - | Bucket secret access key |
Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
nightly --commit string --endpoint env:MYSECRET --bucket env:MYSECRET --access-key-id env:MYSECRET --secret-access-key env:MYSECRETfunc (m *MyModule) Example(commit string, endpoint *dagger.Secret, bucket *dagger.Secret, accessKeyId *dagger.Secret, secretAccessKey *dagger.Secret) *dagger.Directory {
return dag.
Tapes().
Nightly(commit, endpoint, bucket, accessKeyId, secretAccessKey)
}@function
def example(commit: str, endpoint: dagger.Secret, bucket: dagger.Secret, access_key_id: dagger.Secret, secret_access_key: dagger.Secret) -> dagger.Directory:
return (
dag.tapes()
.nightly(commit, endpoint, bucket, access_key_id, secret_access_key)
)@func()
example(commit: string, endpoint: Secret, bucket: Secret, accessKeyId: Secret, secretAccessKey: Secret): Directory {
return dag
.tapes()
.nightly(commit, endpoint, bucket, accessKeyId, secretAccessKey)
}uploadInstallSh() 🔗
UploadInstallSh uploads the install.sh script to the artifacts bucket
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| endpoint | Secret ! | - | Bucket endpoint URL |
| bucket | Secret ! | - | Bucket name |
| accessKeyId | Secret ! | - | Bucket access key ID |
| secretAccessKey | Secret ! | - | Bucket secret access key |
Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
upload-install-sh --endpoint env:MYSECRET --bucket env:MYSECRET --access-key-id env:MYSECRET --secret-access-key env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, endpoint *dagger.Secret, bucket *dagger.Secret, accessKeyId *dagger.Secret, secretAccessKey *dagger.Secret) {
return dag.
Tapes().
UploadInstallSh(ctx, endpoint, bucket, accessKeyId, secretAccessKey)
}@function
async def example(endpoint: dagger.Secret, bucket: dagger.Secret, access_key_id: dagger.Secret, secret_access_key: dagger.Secret) -> None:
return await (
dag.tapes()
.upload_install_sh(endpoint, bucket, access_key_id, secret_access_key)
)@func()
async example(endpoint: Secret, bucket: Secret, accessKeyId: Secret, secretAccessKey: Secret): Promise<void> {
return dag
.tapes()
.uploadInstallSh(endpoint, bucket, accessKeyId, secretAccessKey)
}checkLint() 🔗
CheckLint runs golangci-lint against the tapes source code without applying fixes.
Return Type
String ! Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
check-lintfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Tapes().
CheckLint(ctx)
}@function
async def example() -> str:
return await (
dag.tapes()
.check_lint()
)@func()
async example(): Promise<string> {
return dag
.tapes()
.checkLint()
}fixLint() 🔗
FixLint runs golangci-lint against the tapes source code with –fix, applying automatic fixes where possible, and returns the modified source directory.
Return Type
Directory ! Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
fix-lintfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Tapes().
FixLint()
}@function
def example() -> dagger.Directory:
return (
dag.tapes()
.fix_lint()
)@func()
example(): Directory {
return dag
.tapes()
.fixLint()
}build() 🔗
Build and return directory of go binaries for all platforms. Linux targets are cross-compiled using Zig as the C toolchain. Darwin targets are cross-compiled using osxcross (macOS SDK
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ldflags | String | "-s -w" | Linker flags for go build |
Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
buildfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Tapes().
Build()
}@function
def example() -> dagger.Directory:
return (
dag.tapes()
.build()
)@func()
example(): Directory {
return dag
.tapes()
.build()
}buildRelease() 🔗
BuildRelease compiles versioned release binaries with embedded version info
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String ! | - | Version string of build |
| commit | String ! | - | Git commit SHA of build |
Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
build-release --version string --commit stringfunc (m *MyModule) Example(version string, commit string) *dagger.Directory {
return dag.
Tapes().
BuildRelease(version, commit)
}@function
def example(version: str, commit: str) -> dagger.Directory:
return (
dag.tapes()
.build_release(version, commit)
)@func()
example(version: string, commit: string): Directory {
return dag
.tapes()
.buildRelease(version, commit)
}checkGenerate() 🔗
CheckGenerate verifies that generated code (e.g. ent) is up to date by running go generate and diffing the result against the committed files.
Return Type
String ! Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
check-generatefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Tapes().
CheckGenerate(ctx)
}@function
async def example() -> str:
return await (
dag.tapes()
.check_generate()
)@func()
async example(): Promise<string> {
return dag
.tapes()
.checkGenerate()
}test() 🔗
Test runs the tapes unit tests via “go test”
Return Type
String ! Example
dagger -m github.com/papercomputeco/tapes@352f25238270c655d00e6d35e25c411f3d22f1b8 call \
testfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Tapes().
Test(ctx)
}@function
async def example() -> str:
return await (
dag.tapes()
.test()
)@func()
async example(): Promise<string> {
return dag
.tapes()
.test()
}