From aa06f6076200d2d1b9adb2a8cc481e2bd491fa63 Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:05:25 +0300 Subject: [PATCH 1/8] =?UTF-8?q?=E2=9C=A8=20feat:=20Add=20relay=20docker=20?= =?UTF-8?q?image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- relay.Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 relay.Dockerfile diff --git a/relay.Dockerfile b/relay.Dockerfile new file mode 100644 index 00000000..af8ff2c4 --- /dev/null +++ b/relay.Dockerfile @@ -0,0 +1,23 @@ +#Git clone kixelated's moq-rs then build the moq-relay and push it to the final image +#Copied from https://github.com/kixelated/moq-rs/blob/main/Dockerfile +FROM rust:bookworm as builder + +WORKDIR /build + +RUN apt-get install -y git + +RUN git clone https://github.com/kixelated/moq-rs . + +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/build/target \ + cargo build --release && cp /build/target/release/moq-* /usr/local/cargo/bin + +FROM debian:bookworm-slim + +RUN apt-get update && \ + apt-get install -y --no-install-recommends ca-certificates curl libssl3 && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=builder /usr/local/cargo/bin/moq-relay /usr/local/bin + +CMD ["moq-relay"] \ No newline at end of file From feeba5c8077b1afdfcda1d0621821806eb75d74a Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:06:43 +0300 Subject: [PATCH 2/8] feat: add GH workflow to build image --- .github/workflows/relay.yml | 93 +++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/relay.yml diff --git a/.github/workflows/relay.yml b/.github/workflows/relay.yml new file mode 100644 index 00000000..b8723fd7 --- /dev/null +++ b/.github/workflows/relay.yml @@ -0,0 +1,93 @@ +#Tabs not spaces, you moron :) + +name: CI for netris:relay + +on: + pull_request: + paths: + - "relay.Dockerfile" + - ".github/workflows/relay.yml" + schedule: + - cron: 0 0 * * * # At the end of everyday + push: + branches: [main] + paths: + - "relay.Dockerfile" + - ".github/workflows/relay.yml" + tags: + - v*.*.* + release: + types: [created] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + REGISTRY: ghcr.io + IMAGE_NAME: wanjohiryan/netris + BASE_TAG_PREFIX: relay + +jobs: + build-docker-pr: + name: Build image on pr + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - + name: Checkout repo + uses: actions/checkout@v4 + - + name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Build Docker image + uses: docker/build-push-action@v5 + with: + file: relay.Dockerfile + context: ./ + push: false + load: true + tags: netris:relay + + build-docker-main: + name: Build image on merge + if: ${{github.ref == 'refs/heads/main'}} + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - + name: Checkout repo + uses: actions/checkout@v4 + - + name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Extract Container metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ env.BASE_TAG_PREFIX }} + # + #tag on release, and a nightly build for 'dev' + tags: | + type=raw,value=nightly,enable={{is_default_branch}} + type=ref,event=tag + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + - + name: Build Docker image + uses: docker/build-push-action@v5 + with: + file: relay.Dockerfile + context: ./ + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From f167e9377941d13bc5055b7077afa9229fe9b696 Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:13:55 +0300 Subject: [PATCH 3/8] fix: change auto-labeller code --- .github/workflows/autolabeller.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autolabeller.yml b/.github/workflows/autolabeller.yml index 22a1c604..27781083 100644 --- a/.github/workflows/autolabeller.yml +++ b/.github/workflows/autolabeller.yml @@ -24,7 +24,8 @@ jobs: with: #TODO: fix all emojis types: |- - ✨ feat + ✨ + feat 🐛 fix 🔨 chore 📝 docs From 1559490e3d48e3aaa63812259dec39cbfea1ebcb Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:15:06 +0300 Subject: [PATCH 4/8] fix: add emoji --- .github/workflows/autolabeller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autolabeller.yml b/.github/workflows/autolabeller.yml index 27781083..5aa4457a 100644 --- a/.github/workflows/autolabeller.yml +++ b/.github/workflows/autolabeller.yml @@ -24,7 +24,7 @@ jobs: with: #TODO: fix all emojis types: |- - ✨ + ✨ feat feat 🐛 fix 🔨 chore From 4c1ddd72d6a527f28d5f6c9718d8274437e5d8f8 Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:17:12 +0300 Subject: [PATCH 5/8] fix: try adding quotation marks --- .github/workflows/autolabeller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autolabeller.yml b/.github/workflows/autolabeller.yml index 5aa4457a..6573d8b7 100644 --- a/.github/workflows/autolabeller.yml +++ b/.github/workflows/autolabeller.yml @@ -24,7 +24,7 @@ jobs: with: #TODO: fix all emojis types: |- - ✨ feat + '✨ feat' feat 🐛 fix 🔨 chore From aa5a14d423bb4f4026ca8a5e08667b2c9a31a05f Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:24:53 +0300 Subject: [PATCH 6/8] fix: add our custom headerPattern --- .github/workflows/autolabeller.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/autolabeller.yml b/.github/workflows/autolabeller.yml index 6573d8b7..0c88d645 100644 --- a/.github/workflows/autolabeller.yml +++ b/.github/workflows/autolabeller.yml @@ -10,6 +10,10 @@ on: - ready_for_review - edited +concurrency: + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: validate: name: Validate PR title @@ -42,6 +46,8 @@ jobs: requireScope: false # Ensures the subject start with an uppercase character. subjectPattern: ^([A-Z]).+$ + headerPattern: '^\s*.*?\s(\w*)(?:\(([\w$.\-*/ ]*)\))?: (.*)$' + headerPatternCorrespondence: type, scope, subject subjectPatternError: | The subject "{subject}" found in the pull request title "{title}" didn't match the configured pattern. Please ensure that the subject From d6dbc5bc435fd63b8b336afcc5194eb021d619cb Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:34:14 +0300 Subject: [PATCH 7/8] fix: try adding quotations to all emoji labelled tags --- .github/workflows/autolabeller.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/autolabeller.yml b/.github/workflows/autolabeller.yml index 0c88d645..51757e0c 100644 --- a/.github/workflows/autolabeller.yml +++ b/.github/workflows/autolabeller.yml @@ -29,16 +29,15 @@ jobs: #TODO: fix all emojis types: |- '✨ feat' - feat - 🐛 fix - 🔨 chore - 📝 docs - ✅ test - 🕵🏽‍♂️ security - 🚮 remove - ♻️ revert - 🏎️ perf - 💫 style + '🐛 fix' + '🔨 chore' + '📝 docs' + '✅ test' + '🕵🏽‍♂️ security' + '🚮 remove' + '♻️ revert' + '🏎️ perf' + '💫 style' deprecate refactor ci From aa9c7d4c25ebd3280491d8ad599850a9e1bfe78d Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:36:23 +0300 Subject: [PATCH 8/8] fix: remove emojis --- .github/workflows/autolabeller.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/autolabeller.yml b/.github/workflows/autolabeller.yml index 51757e0c..4fb3dddd 100644 --- a/.github/workflows/autolabeller.yml +++ b/.github/workflows/autolabeller.yml @@ -28,16 +28,16 @@ jobs: with: #TODO: fix all emojis types: |- - '✨ feat' - '🐛 fix' - '🔨 chore' - '📝 docs' - '✅ test' - '🕵🏽‍♂️ security' - '🚮 remove' - '♻️ revert' - '🏎️ perf' - '💫 style' + feat + fix + chore + docs + test + security + remove + revert + perf + style deprecate refactor ci