Skip to content

ci: include README.md and LICENSE to the final archive #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions .fluentci/src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,26 @@ export const build = async (src = ".") => {
.withEnvVariable("RUSTFLAGS", rustflags)
.withEnvVariable(
"PKG_CONFIG_ALLOW_CROSS",
Deno.env.get("TARGET") !== "x86_64-unknown-linux-gnu" ? "1" : "0"
Deno.env.get("TARGET") !== "x86_64-unknown-linux-gnu" ? "1" : "0",
)
.withEnvVariable(
"C_INCLUDE_PATH",
Deno.env.get("TARGET") !== "x86_64-unknown-linux-gnu"
? "/build/sysroot/usr/include"
: "/usr/include"
: "/usr/include",
)
.withEnvVariable("TAG", Deno.env.get("TAG") || "latest")
.withEnvVariable(
"TARGET",
Deno.env.get("TARGET") || "x86_64-unknown-linux-gnu"
Deno.env.get("TARGET") || "x86_64-unknown-linux-gnu",
)
.withExec(["sh", "-c", "rustup target add $TARGET"])
.withExec(["sh", "-c", "cargo build --release --target $TARGET"])
.withExec(["sh", "-c", "cp target/${TARGET}/release/tunein ."])
.withExec([
"sh",
"-c",
"tar czvf /assets/tunein_${TAG}_${TARGET}.tar.gz tunein",
"tar czvf /assets/tunein_${TAG}_${TARGET}.tar.gz tunein README.md LICENSE",
])
.withExec([
"sh",
Expand All @@ -137,29 +137,31 @@ export const build = async (src = ".") => {
]);

const exe = await ctr.file(
`/app/tunein_${Deno.env.get("TAG")}_${Deno.env.get("TARGET")}.tar.gz`
`/app/tunein_${Deno.env.get("TAG")}_${Deno.env.get("TARGET")}.tar.gz`,
);
await exe.export(
`./tunein_${Deno.env.get("TAG")}_${Deno.env.get("TARGET")}.tar.gz`
`./tunein_${Deno.env.get("TAG")}_${Deno.env.get("TARGET")}.tar.gz`,
);

const sha = await ctr.file(
`/app/tunein_${Deno.env.get("TAG")}_${Deno.env.get("TARGET")}.tar.gz.sha256`
`/app/tunein_${Deno.env.get("TAG")}_${
Deno.env.get("TARGET")
}.tar.gz.sha256`,
);
await sha.export(
`./tunein_${Deno.env.get("TAG")}_${Deno.env.get("TARGET")}.tar.gz.sha256`
`./tunein_${Deno.env.get("TAG")}_${Deno.env.get("TARGET")}.tar.gz.sha256`,
);
return ctr.stdout();
};

export type JobExec = (src?: string) =>
| Promise<string>
| ((
src?: string,
options?: {
ignore: string[];
}
) => Promise<string>);
src?: string,
options?: {
ignore: string[];
},
) => Promise<string>);

export const runnableJobs: Record<Job, JobExec> = {
[Job.test]: test,
Expand Down