Skip to content

Commit ad46038

Browse files
committed
combine toolbox workflow with this repo, bump libeevee version
1 parent 6f410ff commit ad46038

File tree

12 files changed

+736
-103
lines changed

12 files changed

+736
-103
lines changed

.github/workflows/npm-publish-github-packages.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/workflow.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build NPM Package & Toolbox Image
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
run-npm-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
- run: npm test
17+
18+
publish-gpr:
19+
needs: run-npm-test
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
registry-url: https://npm.pkg.github.com/
30+
- run: npm ci
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
34+
35+
build-container-image:
36+
needs: publish-gpr
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v5
41+
42+
- name: Set up QEMU
43+
uses: docker/setup-qemu-action@v3
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Log in to the Container registry
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ${{ env.REGISTRY }}
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Extract metadata (tags, labels) for Docker
56+
id: meta
57+
uses: docker/metadata-action@v5
58+
with:
59+
images: ${{ env.REGISTRY }}/${{ github.repository }}
60+
tags: |
61+
type=ref,event=branch
62+
type=ref,event=tag
63+
type=ref,event=pr
64+
type=sha,format=short
65+
type=raw,value=latest,priority=900,enable={{is_default_branch}}
66+
67+
- name: Build and Push
68+
uses: docker/bake-action@v6
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
with:
72+
push: true
73+
files: |
74+
./toolbox/docker-bake.hcl
75+
cwd://${{ steps.meta.outputs.bake-file }}
76+
targets: build

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@eeveebot:registry=https://npm.pkg.github.com/

app/bin/cli.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env node
2+
3+
"use strict";
4+
5+
import { NatsClient } from "../lib/nats-client.mjs";
6+
import { log } from "../lib/log.mjs";
7+
8+
const natsClients = [];
9+
const natsSubscriptions = [];
10+
11+
//
12+
// Do whatever teardown is necessary before calling common handler
13+
process.on("SIGINT", () => {
14+
natsClients.forEach((natsClient) => {
15+
natsClient.drain();
16+
});
17+
});
18+
19+
process.on("SIGTERM", () => {
20+
natsClients.forEach((natsClient) => {
21+
natsClient.drain();
22+
});
23+
});
24+
25+
//
26+
// Setup NATS connection
27+
28+
// Get host and token
29+
const natsHost = process.env.NATS_HOST || false;
30+
if (!natsHost) {
31+
const msg = "environment variable NATS_HOST is not set.";
32+
throw new Error(msg);
33+
}
34+
35+
const natsToken = process.env.NATS_TOKEN || false;
36+
if (!natsToken) {
37+
const msg = "environment variable NATS_TOKEN is not set.";
38+
throw new Error(msg);
39+
}
40+
41+
const nats = new NatsClient({
42+
natsHost: natsHost,
43+
natsToken: natsToken,
44+
});
45+
natsClients.push(nats);
46+
await nats.connect();
47+
48+
const sub = nats.subscribe('control.connectors.irc.>', (subject, message) => {
49+
log.info(subject, message);
50+
});
51+
natsSubscriptions.push(sub);
File renamed without changes.

0 commit comments

Comments
 (0)