Skip to content

Commit

Permalink
ci: fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jan 22, 2024
1 parent 2eacdc4 commit 0dccd3d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
43 changes: 31 additions & 12 deletions .fluentci/src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export async function compile(
"compile",
"-A",
"--output",
output,
"fluentci",
"--target",
Deno.env.get("TARGET") || target,
file,
Expand All @@ -180,26 +180,45 @@ export async function compile(
.withExec([
"tar",
"czvf",
`/assets/${output}_${Deno.env.get("TAG") || ""}_${
`/assets/fluentci_${Deno.env.get("TAG") || ""}_${
Deno.env.get("TARGET") || target
}.tar.gz`,
output,
"fluentci",
])
.withExec([
"sh",
"-c",
`shasum -a 256 /assets/${output}_${Deno.env.get("TAG") || ""}_${
`shasum -a 256 /assets/fluentci_${Deno.env.get("TAG") || ""}_${
Deno.env.get("TARGET") || target
}.tar.gz > /assets/${output}_${
Deno.env.get("TAG") || ""
}_${Deno.env.get("TARGET" || target)}.tar.gz.sha256`,
]);

const exe = await ctr.file(`/app/${output}`);
exe.export(`./${output}`);
}.tar.gz > /assets/fluentci_${Deno.env.get("TAG") || ""}_${
Deno.env.get("TARGET") || target
}.tar.gz.sha256`,
])
.withExec(["sh", "-c", "cp /assets/* /app"]);

const sha256 = await ctr.file(
`/app/fluentci_${Deno.env.get("TAG") || ""}_${
Deno.env.get("TARGET") || target
}.tar.gz.sha256`
);
const tar = await ctr.file(
`/app/fluentci_${Deno.env.get("TAG") || ""}_${
Deno.env.get("TARGET") || target
}.tar.gz`
);
tar.export(
`./fluentci_${Deno.env.get("TAG") || ""}_${
Deno.env.get("TARGET") || target
}.tar.gz`
);
sha256.export(
`./fluentci_${Deno.env.get("TAG") || ""}_${
Deno.env.get("TARGET") || target
}.tar.gz.sha256`
);

await ctr.stdout();
id = await exe.id();
id = await tar.id();
});

return id;
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build
run: |
deno install --import-map=https://deno.land/x/fluentci@v0.6.9/import_map.json -A -r -f https://deno.land/x/fluentci@v0.6.9/main.ts -n fluentci
deno install --import-map=https://deno.land/x/fluentci@v0.10.9/import_map.json -A -r -f https://deno.land/x/fluentci@v0.10.9/main.ts -n fluentci
fluentci run . compile
env:
TAG: ${{ env.RELEASE_VERSION }}
TARGET: ${{ matrix.target }}
- name: Upload release assets
run: |
for ext in tar.gz tar.gz.sha256; do
export FILE=/assets/fluentci_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.$ext
export FILE=/app/fluentci_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.$ext
fluentci run github_pipeline release_upload
done
env:
Expand Down

0 comments on commit 0dccd3d

Please sign in to comment.