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 c69ce0f
Show file tree
Hide file tree
Showing 46 changed files with 413,879 additions and 661 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build-crates-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build crates (Artifacts)

on:
workflow_call:
inputs:
repo:
type: string
required: true
version:
type: string
required: true
branch:
type: string
required: true
artifact-patterns:
type: string
required: true
exclude-builds:
type: string
required: false
workflow_dispatch:
inputs:
repo:
type: string
required: true
version:
type: string
required: true
branch:
type: string
required: true
artifact-patterns:
type: string
required: true
exclude-builds:
type: string
required: false

jobs:
build-crates-artifacts:
runs-on: ${{ matrix.build.os }}
strategy:
fail-fast: false
matrix:
exclude: ${{ inputs.exclude-builds }}
build:
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: x86_64-unknown-linux-musl, os: ubuntu-20.04 }
- { target: arm-unknown-linux-gnueabi, os: ubuntu-20.04 }
- { target: arm-unknown-linux-gnueabihf, os: ubuntu-20.04 }
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-20.04 }
- { target: aarch64-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: aarch64-unknown-linux-musl, os: ubuntu-20.04 }
- { target: x86_64-apple-darwin, os: macos-11 }
- { target: aarch64-apple-darwin, os: macos-11 }
- { target: x86_64-pc-windows-msvc, os: windows-2019 }
- { target: x86_64-pc-windows-gnu, os: windows-2019 }
steps:
- id: build
uses: eclipse-zenoh/ci/build-crates-artifacts@main
with:
repo: ${{ inputs.repo }}
version: ${{ inputs.version }}
branch: ${{ inputs.branch }}
target: ${{ matrix.build.target }}
artifact-patterns: ${{ inputs.artifact-patterns }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
46 changes: 46 additions & 0 deletions .github/workflows/build-crates-debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build crates (Debian)

on:
workflow_call:
inputs:
repo:
type: string
required: true
version:
type: string
required: true
branch:
type: string
required: true
workflow_dispatch:
inputs:
repo:
type: string
required: true
version:
type: string
required: true
branch:
type: string
required: true

jobs:
build-crates-debian:
runs-on: ${{ matrix.build.os }}
strategy:
fail-fast: false
matrix:
build:
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: arm-unknown-linux-gnueabi, os: ubuntu-20.04 }
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-20.04 }
- { target: aarch64-unknown-linux-gnu, os: ubuntu-20.04 }
steps:
- id: build
uses: eclipse-zenoh/ci/build-crates-debian@main
with:
repo: ${{ inputs.repo }}
version: ${{ inputs.version }}
branch: ${{ inputs.branch }}
target: ${{ matrix.build.target }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
44 changes: 44 additions & 0 deletions .github/workflows/publish-crates-cargo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish crates (Cargo)

on:
workflow_call:
inputs:
repos:
type: string
required: true
dry-run:
type: string
required: true
branch:
type: string
required: true
inter-deps-pattern:
type: string
required: true
workflow_dispatch:
inputs:
repos:
type: string
required: true
dry-run:
type: string
required: true
branch:
type: string
required: true
inter-deps-pattern:
type: string
required: true

jobs:
publish-crates-cargo:
runs-on: ubuntu-latest
steps:
- uses: eclipse-zenoh/ci/publish-crates-cargo@main
with:
repos: ${{ inputs.repos }}
dry-run: ${{ inputs.dry-run }}
branch: ${{ inputs.branch }}
inter-deps-pattern: ${{ inputs.inter-deps-pattern }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
crates-io-token: ${{ secrets.CRATES_IO_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/publish-crates-debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish crates (Debian)

on:
workflow_call:
inputs:
dry-run:
type: string
required: true
version:
type: string
required: true
workflow_dispatch:
inputs:
dry-run:
type: string
required: true
version:
type: string
required: true

jobs:
publish-crates-debian:
runs-on: ubuntu-latest
steps:
- uses: eclipse-zenoh/ci/publish-crates-debian@main
with:
dry-run: ${{ inputs.dry-run }}
version: ${{ inputs.version }}
ssh-host: [email protected]
ssh-host-path: /home/data/httpd/download.eclipse.org/zenoh/debian-repo
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-passphrase: ${{ secrets.SSH_PASSPHRASE }}
65 changes: 65 additions & 0 deletions .github/workflows/publish-crates-homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish crates (Homebrew)

on:
workflow_call:
inputs:
repo:
type: string
required: true
dry-run:
type: string
required: true
version:
type: string
required: true
branch:
type: string
required: true
artifact-patterns:
type: string
required: true
formulae:
type: string
required: true
workflow_dispatch:
inputs:
repo:
type: string
required: true
dry-run:
type: string
required: true
version:
type: string
required: true
branch:
type: string
required: true
artifact-patterns:
type: string
required: true
formulae:
type: string
required: true

jobs:
publish-crates-homebrew:
runs-on: macos-latest
steps:
- uses: eclipse-zenoh/ci/publish-crates-homebrew@main
with:
repo: ${{ inputs.repo }}
dry-run: ${{ inputs.dry-run }}
version: ${{ inputs.version }}
branch: ${{ inputs.branch }}
formulae: ${{ inputs.formulae }}
artifact-patterns: ${{ inputs.artifact-patterns }}
tap: eclipse-zenoh/homebrew-zenoh
ssh-host: [email protected]
ssh-host-path: /home/data/httpd/download.eclipse.org/zenoh/homebrew-tap
ssh-host-url: https://download.eclipse.org/zenoh/homebrew-tap
actor-name: eclipse-zenoh-bot
actor-email: [email protected]
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-passphrase: ${{ secrets.SSH_PASSPHRASE }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
56 changes: 56 additions & 0 deletions .github/workflows/tag-crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Tag crates

on:
workflow_call:
inputs:
repo:
type: string
required: true
dry-run:
type: boolean
required: true
version:
type: string
required: true
inter-deps-pattern:
type: string
required: true
inter-deps-version:
type: string
required: false
workflow_dispatch:
inputs:
repo:
type: string
required: true
dry-run:
type: boolean
required: true
version:
type: string
required: true
inter-deps-pattern:
type: string
required: true
inter-deps-version:
type: string
required: false

jobs:
tag-crates:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag-crates.outputs.version }}
branch: ${{ steps.tag-crates.outputs.branch }}
steps:
- id: tag-crates
uses: eclipse-zenoh/ci/tag-crates@main
with:
repo: ${{ inputs.repo }}
dry-run: ${{ inputs.dry-run }}
version: ${{ inputs.version }}
inter-deps-pattern: ${{ inputs.inter-deps-pattern }}
inter-deps-version: ${{ inputs.inter-deps-version }}
actor-name: eclipse-zenoh-bot
actor-email: [email protected]
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
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
Loading

0 comments on commit c69ce0f

Please sign in to comment.