Skip to content
Draft
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
17 changes: 17 additions & 0 deletions .github/actions/setup-smithy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Setup Smithy CLI'
description: 'Install Smithy CLI for building the project'

runs:
using: 'composite'
steps:
- name: Install Smithy CLI
shell: bash
env:
SMITHY_VERSION: '1.61.0'
run: |
mkdir -p smithy-install/smithy
curl -L https://github.com/smithy-lang/smithy/releases/download/${SMITHY_VERSION}/smithy-cli-linux-x86_64.zip -o smithy-install/smithy-cli-linux-x86_64.zip
unzip -qo smithy-install/smithy-cli-linux-x86_64.zip -d smithy-install
mv smithy-install/smithy-cli-linux-x86_64/* smithy-install/smithy
sudo smithy-install/smithy/install
smithy --version
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: release
run-name: release ${{ inputs.tag }}

on:
push:
branches:
- improvement/CLDSRVCLT-7
workflow_dispatch:
inputs:
tag:
description: 'Tag to be released (e.g., 1.0.0)'
required: true



jobs:
build-and-tag:
name: Build and tag
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Setup Smithy CLI
uses: ./.github/actions/setup-smithy

- name: Build project
run: yarn build

- name: Create Tag with Build Artifacts
run: |
# Configure git user to the GitHub Actions bot
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

# Force add the build folders (even if they are in .gitignore)
git add -f dist build

# Check if there are changes to commit
if git diff --staged --quiet; then
echo "No changes in build folders or build failed to produce output."
exit 1
fi

# Determine tag name
TAG_NAME="${{ inputs.tag }}"
if [ -z "$TAG_NAME" ]; then
TAG_NAME="test-${{ github.sha }}"
fi

# Commit the build artifacts
git commit -m "Build artifacts for version $TAG_NAME"

# Create the tag
git tag $TAG_NAME

# Push the tag to the repository
git push origin $TAG_NAME

# Export tag name for next step
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
id: create_tag

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.create_tag.outputs.tag_name }}
name: Release ${{ steps.create_tag.outputs.tag_name }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
lint:
name: Lint and typecheck
runs-on: ubuntu-latest
needs: lint

steps:
- name: Checkout code
Expand All @@ -27,6 +28,12 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Setup Smithy CLI
uses: ./.github/actions/setup-smithy

- name: Build
run: yarn build

- name: TypeScript typecheck
run: yarn typecheck

Expand All @@ -51,6 +58,12 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Setup Smithy CLI
uses: ./.github/actions/setup-smithy

- name: Build
run: yarn build

- name: Start Cloudserver with MongoDB backend
run: docker compose -f .github/docker-compose.cloudserver-mongo.yml up -d

Expand Down Expand Up @@ -84,6 +97,12 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Setup Smithy CLI
uses: ./.github/actions/setup-smithy

- name: Build
run: yarn build

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/wait_for_local_port.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e

PORT=$1
TIMEOUT=${2:-30}

echo "Waiting for port $PORT to be ready (timeout: ${TIMEOUT}s)..."

for i in $(seq 1 $TIMEOUT); do
if nc -z localhost $PORT 2>/dev/null; then
echo "Port $PORT is ready!"
exit 0
fi
echo "Attempt $i/$TIMEOUT: Port $PORT not ready yet..."
sleep 1
done

echo "ERROR: Port $PORT did not become ready within ${TIMEOUT}s"
exit 1
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ out

# Nuxt.js build / generate output
.nuxt
# For now, the `dist` folder is commited: so we should not ignore it
#dist

# Build output
build/
dist/

# Gatsby files
.cache/
Expand Down
1 change: 0 additions & 1 deletion build/smithy/classpath.json

This file was deleted.

Loading