Skip to content

Commit

Permalink
feat: Support homebrew, debian, artifacts builds/publishing
Browse files Browse the repository at this point in the history
fix: Incorrect git push command

chore: Debug killed estuary process pid

fix: publish-perifs-cargo killing pid 0

fix: tag-perif not running cleanup on return

chore(tag-perif): Debug deleted repository

fix: Avoid failing on multiple dry-run publish in same branch

fix(tag-perif): Floating promise

feat: upload-to-eclipse action

feat: download-from-eclipse action

feat: build-perif-debian action

chore: Test build-and-publish-perif-debian workflow

fix: Typo (branch -> version)

fix: Typo (main -> post)

fix: Use x86_64 self-hosted runners

chore: Log built Debian packages

fix(build-perif-debian): Only run cross once

fix({download-from,upload-to}-eclipse): Invalid syntax

feat: build-perif-debian action (JS) plus tests

feat: release-crates-homebrew, {build,publish}-crates-artifacts

feat(tag-crates): Add version output

fix: Non-existing artifacts-pattern input

fix(publish-crates-debian): Download artifacts by id

fix(release-crates-homebrew): Typo

fix(tag-crates): Unquoted argument

chore: Remove post and pre script

fix(cargo): Use stable toolchain when compiling Cargo binary

fix(build-crates-artifacts): Cleanup on exit/error

chore(release-crates-homebrew): Simplify inputs

fix(release-crates-homebrew): Typo

fix(release-crates-homebrew): Typo

fix(publish-crates-homebrew): Rename release -> publish

fix(publish-crates-debian): Incomplete cleanup

fix(cargo): Unzipped artifact

fix(publish-crates-homebrew): Incorrect brew commads

fix(publish-crates-homebrew): Use --ingnore-dependencies when uninstalling

fix(publish-crates-debian): Download input artifacts by name

fix(publish-crates-homebrew): Don't upload to ssh host in dry-run

fix(publish-crates-debian):  Match arifacts with regexp

fix(publish-crates-cargo): Catch process.kill() exception

fix(publish-crates-debian): Download artifact to absolute path

fix(publish-crates-debian): Assume artifact name

fix(publish-crates-homebrew): Delete everything on cleanup

fix(publish-crates-debian): Update package lists when adding repo

fix(publish-crates-homebrew): Use wget instead of curl to download zip

fix(publish-crates-debain): Remove packages after attempting to install them

fix(publish-crates-homebrew): Don't download archive

fix(publish-crates-homebrew): Build multiple targets at the same time

fix(build-crates-debian): Use custom Debian version

Surely you must be joking cargo-deb!

fix(publish-crates-debian): Only download latest lartifacts

fix(cargo): Remove added "-1" revision in bumpDebianPackages

fix(publish-crates-debian): Force purge installed packages

fix(build-crates-artifacts): Simply artifact-patterns input

chore(tag-crates): Rename nightly -> dry-run

fix(publish-crates-cargo): Switch to dry-run style action

fix(publish-crates-cargo): All inputs are required
  • Loading branch information
fuzzypixelz committed Feb 23, 2024
1 parent 4448e85 commit 5dcaa83
Show file tree
Hide file tree
Showing 40 changed files with 413,572 additions and 540 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
.envrc
.DS_Store
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 100,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
Expand Down
27 changes: 9 additions & 18 deletions __tests__/cargo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { mkdtemp, realpath } from "fs/promises";
import { createWriteStream, rmSync } from "fs";
import * as https from "https";

import { run } from "../src/run";
import { sh } from "../src/command";
import * as cargo from "../src/cargo";

export async function downloadGitHubRepo(repo: string, commit: string): Promise<string> {
const url = `https://codeload.github.com/${repo}/tar.gz/${commit}`;
export async function downloadGitHubRepo(repo: string, ref: string): Promise<string> {
const url = `https://codeload.github.com/${repo}/tar.gz/${ref}`;

let tmp = await mkdtemp(join(tmpdir(), commit));
let tmp = await mkdtemp(join(tmpdir(), "git"));
tmp = await realpath(tmp);

return new Promise(resolve => {
Expand All @@ -23,9 +23,9 @@ export async function downloadGitHubRepo(repo: string, commit: string): Promise<
res.pipe(archive);
archive.on("finish", () => {
archive.close();
run("tar", ["-x", "-z", "-f", archiveName], { cwd: tmp });
sh(`tar -x -f ${archiveName}`, { cwd: tmp });
rmSync(archiveName);
resolve(join(tmp, `${repo.split("/").at(1)}-${commit}`));
resolve(join(tmp, `${repo.split("/").at(1)}-${ref}`));
});
});
});
Expand Down Expand Up @@ -68,10 +68,7 @@ describe("cargo", () => {
});

test("list packages zenoh-backend-s3", async () => {
const tmp = await downloadGitHubRepo(
"eclipse-zenoh/zenoh-backend-s3",
"3761d5986fa12318e175341bc97524fe5a961cfa",
);
const tmp = await downloadGitHubRepo("eclipse-zenoh/zenoh-backend-s3", "3761d5986fa12318e175341bc97524fe5a961cfa");

const packages = cargo.packages(tmp);
await rm(tmp, { recursive: true, force: true });
Expand All @@ -89,10 +86,7 @@ describe("cargo", () => {
});

test("list packages zenoh", async () => {
const tmp = await downloadGitHubRepo(
"eclipse-zenoh/zenoh",
"8cd786f2192fd2aa7387432ae93cdd78f5db1df2",
);
const tmp = await downloadGitHubRepo("eclipse-zenoh/zenoh", "8cd786f2192fd2aa7387432ae93cdd78f5db1df2");
const order = [...cargo.packagesOrdered(tmp)].map(p => p.name);
await rm(tmp, { recursive: true, force: true });
const expectedOrder = [
Expand Down Expand Up @@ -135,10 +129,7 @@ describe("cargo", () => {
});

test("bump deps debian zenoh-kotlin", async () => {
const tmp = await downloadGitHubRepo(
"eclipse-zenoh/zenoh-kotlin",
"836d778a515939a469b7c6f05c36a63814e98050",
);
const tmp = await downloadGitHubRepo("eclipse-zenoh/zenoh-kotlin", "836d778a515939a469b7c6f05c36a63814e98050");

await cargo.bumpDebianDependencies(join(tmp, "zenoh-jni"), /zenoh.*/g, "1.2.3-beta.0");
});
Expand Down
61 changes: 0 additions & 61 deletions __tests__/publish-perifs-cargo.test.ts

This file was deleted.

76 changes: 0 additions & 76 deletions __tests__/tag-perif.test.ts

This file was deleted.

23 changes: 23 additions & 0 deletions build-crates-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build crates (Artifacts)

inputs:
repo:
required: true
version:
required: true
branch:
required: true
target:
required: true
artifact-patterns:
required: true
github-token:
required: true

outputs:
artifact-id:
description: Artifact id

runs:
using: node20
main: ../dist/build-crates-artifacts-main.js
21 changes: 21 additions & 0 deletions build-crates-debian/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build crates (Debian)

inputs:
repo:
required: true
version:
required: true
branch:
required: true
target:
required: true
github-token:
required: true

outputs:
artifact-id:
description: Artifact id

runs:
using: node20
main: ../dist/build-crates-debian-main.js
6 changes: 3 additions & 3 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const child_process = require("child_process");
async function main() {
const dir = await fs.opendir("src");
for await (const dirent of dir) {
if (dirent.name.endsWith("-main.ts")) {
if (["-pre.ts", "-main.ts", "-post.ts"].some(x => dirent.name.endsWith(x))) {
console.log(`> Transpiling ${dirent.name}`);
child_process.execSync(`ncc build src/${dirent.name} --out dist`);
const name = dirent.name.replace("ts", "js");
child_process.execSync(`ncc build src/${dirent.name} --out dist`, { stdio: "inherit" });
const name = dirent.name.replace(".ts", ".js");
fs.rename("dist/index.js", `dist/${name}`);
console.log(`> Generated dist/${name}`);
}
Expand Down
Loading

0 comments on commit 5dcaa83

Please sign in to comment.