Skip to content

Commit c896e38

Browse files
committed
chore: Push components
1 parent 8a0d437 commit c896e38

3 files changed

Lines changed: 123 additions & 0 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: push-components
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "The tag to be used when pushing components to the Docker Hub."
11+
required: true
12+
type: string
13+
ref:
14+
description: "The ref (branch or SHA) to process"
15+
required: true
16+
type: string
17+
default: "main"
18+
19+
defaults:
20+
run:
21+
shell: bash -xe {0}
22+
23+
jobs:
24+
push-components:
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- uses: actions/checkout@v5
28+
with:
29+
ref: ${{ github.event.inputs.ref }} # Use the ref if provided, otherwise defaults to the current branch/commit
30+
31+
- uses: nixbuild/nix-quick-install-action@v34
32+
with:
33+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
34+
nix_conf: |
35+
extra-substituters = https://cache.garnix.io
36+
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g
37+
- name: Populate the nix store
38+
run: |
39+
nix develop --command echo
40+
41+
- name: Log in to Docker Hub
42+
run: |
43+
echo "$DOCKER_HUB_TOKEN" | docker login -u "$DOCKER_HUB_USERNAME" --password-stdin
44+
env:
45+
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
46+
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
47+
48+
- name: Run push-components.sh
49+
run: |
50+
nix develop --command ./scripts/push-components.sh $TAG
51+
env:
52+
TAG: ${{ github.event.inputs.tag }}
53+
54+
- name: Configure git before push
55+
run: |
56+
git config user.name "github-actions[bot]"
57+
git config user.email "github-actions[bot]@users.noreply.github.com"
58+
59+
- name: Push obelisk-oci.toml
60+
run: |
61+
git add obelisk-oci.toml
62+
git commit -m "chore: Bump components to $TAG"
63+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
64+
git push origin ${{ github.event.inputs.ref }}
65+
env:
66+
TAG: ${{ github.event.inputs.tag }}
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

obelisk-oci.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
api.listening_addr = "127.0.0.1:5005"
2+
webui.listening_addr = "127.0.0.1:8080"
3+
4+
[log.stdout]
5+
enabled = true
6+
7+
[[activity_wasm]]
8+
name = "activity_fly_http"
9+
location.oci = "docker.io/getobelisk/components_flyio_activity_fly_http:2025-09-28@sha256:41d1e9af0a0ef46b182f459e5113f224aa9cb29af197a8d841f8a1845d708ae6"
10+
max_retries = 0
11+
exec.lock_expiry.seconds = 15
12+
env_vars = ["FLY_API_TOKEN"]
13+
forward_stdout = "stderr"
14+
forward_stderr = "stderr"
15+
16+
[[webhook_endpoint]]
17+
name = "webhook_fly_secrets_updater"
18+
location.oci = "docker.io/getobelisk/components_flyio_webhook_fly_secrets_updater:2025-09-28@sha256:ce78a2bcf3c47ca7409fba65a666f81397479985b0b1796bb06cbe5a6c98dc06"
19+
http_server = "webhook_server"
20+
routes = [{ methods = ["POST"], route = "/" }]
21+
env_vars = ["FLY_API_TOKEN"]
22+
forward_stdout = "stderr"
23+
forward_stderr = "stderr"
24+
25+
[[http_server]]
26+
name = "webhook_server"
27+
listening_addr = "0.0.0.0:9090"

scripts/push-components.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
# Pushes all WASM components to the Docker Hub and updates obelisk-oci.toml
4+
5+
set -exuo pipefail
6+
cd "$(dirname "$0")/.."
7+
8+
TAG="$1"
9+
TOML_FILE="obelisk-oci.toml"
10+
PREFIX="docker.io/getobelisk/components_flyio_"
11+
12+
push() {
13+
RELATIVE_PATH=$1
14+
FILE_NAME_WITHOUT_EXT=$(basename "$RELATIVE_PATH" | sed 's/\.[^.]*$//')
15+
OCI_LOCATION="${PREFIX}${FILE_NAME_WITHOUT_EXT}:${TAG}"
16+
echo "Pushing ${RELATIVE_PATH} to ${OCI_LOCATION}..."
17+
OUTPUT=$(obelisk client component push "$RELATIVE_PATH" "$OCI_LOCATION")
18+
19+
# Replace the old location with the actual OCI location
20+
sed -i -E "/name = \"${FILE_NAME_WITHOUT_EXT}\"/{n;s|location\.oci = \".*\"|location.oci = \"${OUTPUT}\"|}" "$TOML_FILE"
21+
}
22+
23+
# Build components
24+
just build
25+
26+
push "target/wasm32-wasip2/release/activity_fly_http.wasm"
27+
push "target/wasm32-wasip2/release/webhook_fly_secrets_updater.wasm"
28+
29+
echo "All components pushed and TOML file updated successfully."

0 commit comments

Comments
 (0)