Skip to content
Open
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
32 changes: 32 additions & 0 deletions .github/actions/setup-and-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Setup and Build'
description: 'Common setup steps: install dependencies, setup Smithy, cache, and build'

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

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

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

- name: Cache build output
uses: actions/cache@v4
with:
path: |
build/
dist/
key: build-${{ hashFiles('models/**', 'service/**', 'smithy-build.json') }}
restore-keys: |
build-
- name: Build
shell: bash
run: yarn build
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
103 changes: 103 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
name: Release
run-name: Release ${{ github.event.inputs.tag || '0.0.0-test' }}

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

env:
# Use input tag for workflow_dispatch, or test tag for push events
RELEASE_TAG: ${{ github.event.inputs.tag || '0.0.0-test' }}

jobs:
# check:
# name: Preliminary checks
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Ensure version matches tag
# run: |
# PACKAGE_VERSION=$(node -p "require('./package.json').version")
# if [ "$PACKAGE_VERSION" != "${{ env.RELEASE_TAG }}" ]; then
# echo "::error file=package.json::Version $PACKAGE_VERSION doesn't match tag ${{ env.RELEASE_TAG }}"
# exit 1
# fi

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup and Build
uses: ./.github/actions/setup-and-build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
dist/
build/

publish-npm:
name: Publish to npm registry
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts

- name: Setup Node.js for npm registry
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'

- name: Publish to npm with provenance
run: npm publish --provenance --tag test

# create-release:
# name: Create GitHub Release
# runs-on: ubuntu-latest
# needs: publish-npm
# permissions:
# contents: write
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Create Git Tag
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
# git tag ${{ env.RELEASE_TAG }}
# git push origin ${{ env.RELEASE_TAG }}

# - name: Create GitHub Release
# uses: softprops/action-gh-release@v2
# with:
# tag_name: ${{ env.RELEASE_TAG }}
# name: Release ${{ env.RELEASE_TAG }}
# generate_release_notes: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 6 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ jobs:
- 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 and Build
uses: ./.github/actions/setup-and-build

- name: TypeScript typecheck
run: yarn typecheck
Expand All @@ -42,14 +36,8 @@ jobs:
- 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 and Build
uses: ./.github/actions/setup-and-build

- name: Start Cloudserver with MongoDB backend
run: docker compose -f .github/docker-compose.cloudserver-mongo.yml up -d
Expand All @@ -75,14 +63,8 @@ jobs:
- 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 and Build
uses: ./.github/actions/setup-and-build

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ yarn build
### Local testing

1. Install dependencies & build the smithy client: `yarn build`

If you want to try a release build in another project, you can also push your branch after adding this push condition in `release.yml`:
```yaml
# Uncomment to test your work as a release before it's merged
push:
branches:
- improvement/CLDSRVCLT-X
```

2. Start CloudServer: `S3VAULT=mem S3METADATA=mem S3DATA=mem REMOTE_MANAGEMENT_DISABLE=true yarn start`
Some tests require different cloudserver setup :
For example : tests/testIndexesApis.test.ts : `S3METADATA=mongodb`
Expand Down
1 change: 0 additions & 1 deletion build/smithy/classpath.json

This file was deleted.

Loading
Loading