Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/publish-env-def.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish environment definition to registry

on:
workflow_dispatch:
inputs:
version:
description: "spin-up.(ver).toml version, e.g. 3.4, 3.5"
required: true
type: string

jobs:
publish-env-def:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install oras
uses: oras-project/setup-oras@v1

- name: Login to the GitHub registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: spinframeworkbot
password: ${{ secrets.SPIN_WIT_PAT }}

- name: Publish environment TOML
shell: bash
env:
VERSION: ${{ inputs.version }}
run: ./scripts/push-env-def.sh
4 changes: 4 additions & 0 deletions scripts/push-env-def.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -euo pipefail

oras push ghcr.io/spinframework/environments/spin-up:$VERSION target-envs/spin-up.$VERSION.toml
14 changes: 14 additions & 0 deletions target-envs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Spin target environments

This folder contains target environment definitions for Spin. Each target
environment is a TOML file which maps triggers to the WIT worlds supported by
those triggers. When pushed to an OCI registry, these can be referenced
in the Spin manifest `application.targets` array.

Pushed environment definitions should not include the `.toml` extension
and should be versioned using OCI versioning, e.g. `spin-up:3.4`
We avoid using this convention for the source files because 1. syntax
highlighting and 2. Windows filenames.

Versions should include _minor version only_ because WITs should not
change in patch releases.
7 changes: 7 additions & 0 deletions target-envs/spin-up.3.2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default = { worlds = ["spin:up/platform@3.2.0"] }

[triggers]

[triggers.http]
worlds = ["spin:up/http-trigger@3.2.0"]
capabilities = ["local_service_chaining"]
7 changes: 7 additions & 0 deletions target-envs/spin-up.3.4.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default = { worlds = ["spin:up/platform@3.4.0"] }

[triggers]

[triggers.http]
worlds = ["spin:up/http-trigger@3.4.0"]
capabilities = ["local_service_chaining"]
7 changes: 7 additions & 0 deletions target-envs/spin-up.3.5.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default = { worlds = ["spin:up/platform@3.5.0"] }

[triggers]

[triggers.http]
worlds = ["spin:up/http-trigger@3.5.0", "spin:up/http-trigger@3.4.0"]
capabilities = ["local_service_chaining"]