-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
171 additions
and
120 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,125 @@ | ||
name: Publish Package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
test: | ||
type: boolean | ||
description: Skip publishing step | ||
push: | ||
tags: | ||
- "*" | ||
|
||
name: 🚀 Publish Package | ||
|
||
jobs: | ||
build-container: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🤖 Setup Qemu | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: "arm64" | ||
|
||
- name: 🐋 Setup Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: 🦥 Cache Image | ||
id: cache-image | ||
uses: actions/cache@v3 | ||
with: | ||
path: venmic-builder.tar | ||
key: venmic-builder-cache | ||
|
||
- name: 🏗️ Build Image | ||
if: steps.cache-image.outputs.cache-hit != 'true' | ||
run: | | ||
cd docker | ||
docker buildx build --platform=linux/amd64,linux/arm64 --tag venmic-builder . | ||
docker save > venmic-builder.tar | ||
build-x86_64: | ||
needs: build-container | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🦥 Pull Image | ||
uses: actions/cache/restore@v3 | ||
id: cache-container | ||
with: | ||
fail-on-cache-miss: true | ||
path: venmic-builder.tar | ||
key: venmic-builder-cache | ||
|
||
- name: 🐋 Load Container | ||
run: | | ||
docker load < venmic-builder.tar | ||
- name: 🏗️ Build Addon | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
options: -v ${{ github.workspace }}:/work --platform linux/amd64 | ||
image: venmic-builder | ||
shell: bash | ||
run: | | ||
cd /work | ||
pnpm install | ||
- name: ♻️ Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: addon-x86_64 | ||
path: build/Release | ||
|
||
build-arm64: | ||
needs: build-container | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🦥 Pull Image | ||
uses: actions/cache/restore@v3 | ||
id: cache-container | ||
with: | ||
fail-on-cache-miss: true | ||
path: venmic-builder.tar | ||
key: venmic-builder-cache | ||
|
||
- name: 🤖 Setup Qemu | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: "arm64" | ||
|
||
- name: 🐋 Load Container | ||
run: | | ||
docker load < venmic-builder.tar | ||
- name: 🏗️ Build Addon | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
options: -v ${{ github.workspace }}:/work --platform linux/arm64 | ||
image: venmic-builder | ||
shell: bash | ||
run: | | ||
cd /work | ||
pnpm install | ||
- name: ♻️ Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: addon-arm64 | ||
path: build/Release | ||
|
||
publish: | ||
needs: [build-arm64, build-x86_64] | ||
runs-on: ubuntu-latest | ||
container: fedora:37 | ||
|
||
steps: | ||
- name: 📥 Checkout | ||
|
@@ -36,47 +146,26 @@ jobs: | |
version: 8 | ||
run_install: false | ||
|
||
- name: ⏱️ Wait for x86-64 Builds | ||
uses: lewagon/[email protected] | ||
with: | ||
wait-interval: 600 | ||
ref: ${{ github.ref }} | ||
check-name: "build-fedora37" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: 📦 Download Build (x86-64) | ||
id: download-artifact | ||
- name: 📦 Download Build (x86_64) | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: build.yml | ||
name: addon-x86-64 | ||
name: addon-x86_64 | ||
path: build/Release | ||
allow_forks: false | ||
|
||
- name: 🛠️ Prepare Prebuilds (x86-64) | ||
run: pnpm pkg-prebuilds-copy --baseDir build/Release --source venmic-addon.node --name=venmic-addon --strip --napi_version=7 | ||
|
||
- name: ⏱️ Wait for armv8 Builds | ||
uses: lewagon/[email protected] | ||
with: | ||
wait-interval: 600 | ||
ref: ${{ github.ref }} | ||
check-name: "build-fedora37-arm" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: 🛠️ Prepare Prebuilds (x86_64) | ||
run: pnpm pkg-prebuilds-copy --baseDir build/Release --source venmic-addon.node --name=venmic-addon --strip --napi_version=7 --arch=x64 | ||
|
||
- name: 📦 Download Build (armv8) | ||
id: download-artifact | ||
- name: 📦 Download Build (arm64) | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: build.yml | ||
name: addon-armv8 | ||
name: addon-arm64 | ||
path: build/Release | ||
allow_forks: false | ||
|
||
- name: 🛠️ Prepare Prebuilds (armv8) | ||
run: pnpm pkg-prebuilds-copy --baseDir build/Release --source venmic-addon.node --name=venmic-addon --strip --napi_version=7 | ||
- name: 🛠️ Prepare Prebuilds (x86_64) | ||
run: pnpm pkg-prebuilds-copy --baseDir build/Release --source venmic-addon.node --name=venmic-addon --strip --napi_version=7 --arch=arm64 | ||
|
||
- name: 🛒 Publish | ||
if: "${{ github.event.inputs.test != 'true' }}" | ||
run: pnpm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
on: | ||
push: | ||
pull_request: | ||
|
||
name: 🏗️ Build Server | ||
|
||
jobs: | ||
build-fedora: | ||
runs-on: ubuntu-latest | ||
container: fedora:38 | ||
|
||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: 👷 Build Dependencies | ||
run: | | ||
dnf install -y make automake gcc gcc-c++ kernel-devel cmake git | ||
dnf install -y pipewire-devel pipewire-libs pulseaudio-libs-devel pipewire-pulseaudio | ||
- name: 🔨 Build | ||
run: | | ||
cmake -B build | ||
cmake --build build | ||
- name: 🚀 Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: server-x86-64 | ||
path: build/server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
node_modules | ||
.vscode | ||
build | ||
prebuilds | ||
prebuilds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
node_modules | ||
.github | ||
build | ||
|
||
docker | ||
server | ||
tests | ||
build | ||
|
||
.gitignore | ||
.github | ||
|
||
.clang-* | ||
.eslint* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This Dockerfile describes the base image used for compiling the node addon on different CPU-Architectures | ||
|
||
FROM fedora:37 | ||
|
||
# Build dependencies | ||
|
||
RUN dnf install -y make automake gcc gcc-c++ kernel-devel cmake git nodejs | ||
RUN dnf install -y pipewire-devel pipewire-libs pulseaudio-libs-devel pipewire-pulseaudio | ||
|
||
# PNPM | ||
|
||
RUN curl -fsSL https://get.pnpm.io/install.sh | sh - | ||
RUN source /root/.bashrc |