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
61 changes: 61 additions & 0 deletions .github/workflows/release-elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release Elixir (Hex.pm)

on:
push:
tags:
- "ex-v*"

permissions:
contents: read

jobs:
build-and-publish:
runs-on: ubuntu-latest
environment: production
defaults:
run:
working-directory: sdks/ex_sdk
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract version from tag
id: vars
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/}"
VERSION="${TAG#ex-v}"
echo "tag_version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Setup Erlang/Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "26"
elixir-version: "1.16"

- name: Install Hex and Rebar
run: |
mix local.hex --force
mix local.rebar --force

- name: Install dependencies
run: mix deps.get

- name: Verify version matches mix.exs
shell: bash
run: |
FILE_VERSION=$(grep -m1 '@version "' mix.exs | sed -E 's/.*"([^"]+)".*/\1/')
echo "Tag version: ${{ steps.vars.outputs.tag_version }}"
echo "File version: $FILE_VERSION"
if [ "$FILE_VERSION" != "${{ steps.vars.outputs.tag_version }}" ]; then
echo "Version mismatch: tag ${{ steps.vars.outputs.tag_version }} vs mix.exs $FILE_VERSION" >&2
exit 1
fi

- name: Run tests
run: mix test

- name: Publish to Hex.pm
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: mix hex.publish --yes
16 changes: 16 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- 'py-v*'
- 'rs-v*'
- 'npm-v*'
- 'cl-v*'
- 'ex-v*'

permissions:
contents: write
Expand Down Expand Up @@ -34,6 +36,20 @@ jobs:
python sdks/rust_sdk/scripts/release_notes.py --tag "$TAG" > NOTES.md
elif [[ "$TAG" == npm-v* ]]; then
python sdks/js_sdk/scripts/release_notes.py --tag "$TAG" > NOTES.md
elif [[ "$TAG" == cl-v* ]]; then
cat > NOTES.md <<EOF
# Common Lisp SDK Release ${TAG#cl-v}

This release packages updates for the Common Lisp SDK.
See auto-generated release notes below for commit-level details.
EOF
elif [[ "$TAG" == ex-v* ]]; then
cat > NOTES.md <<EOF
# Elixir SDK Release ${TAG#ex-v}

This release packages updates for the Elixir SDK.
See auto-generated release notes below for commit-level details.
EOF
else
echo "Unsupported tag pattern: $TAG" >&2
exit 1
Expand Down
11 changes: 11 additions & 0 deletions sdks/ex_sdk/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ defmodule Sw4rm.MixProject do
name: "SW4RM SDK",
description: "Elixir SDK for the SW4RM multi-agent coordination protocol",
source_url: "https://github.com/sw4rm/sw4rm-sdk-elixir",
package: package(),
docs: [main: "Sw4rm", extras: ["README.md"]]
]
end
Expand All @@ -40,6 +41,16 @@ defmodule Sw4rm.MixProject do
]
end

defp package do
[
licenses: ["Apache-2.0"],
links: %{
"GitHub" => "https://github.com/rahulrajaram/sw4rm",
"Protocol Docs" => "https://github.com/rahulrajaram/sw4rm/tree/master/documentation"
}
]
end

defp proto_gen(_args) do
protos_dir = Path.join([__DIR__, "..", "rust_sdk", "protos"])
out_dir = Path.join([__DIR__, "lib", "sw4rm", "proto"])
Expand Down