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@v6
with:
node-version: '24'
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@v5
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
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: Release
run-name: Release

on:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.package-version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Get version from package.json
id: package-version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT

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

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

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

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

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

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

create-release:
name: Create GitHub Release
runs-on: ubuntu-24.04
needs: [build, publish-npm]
permissions:
contents: write
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.build.outputs.version }}
name: Release ${{ needs.build.outputs.version }}
target_commitish: ${{ github.sha }}
generate_release_notes: true
42 changes: 12 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,14 @@ permissions:
jobs:
lint:
name: Lint and typecheck
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

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

- 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 @@ -35,21 +29,15 @@ jobs:

test-mongodb-backend:
name: Test with MongoDB backend
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: lint

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

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

- 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 @@ -68,21 +56,15 @@ jobs:

test-metadata-backend:
name: Test with Scality metadata backend
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: lint

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

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

- 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
1 change: 0 additions & 1 deletion build/smithy/classpath.json

This file was deleted.

Loading
Loading