Skip to content

Commit a98c3be

Browse files
added release workflow
ISSUE: CLDSRVCLT-7
1 parent e50bd88 commit a98c3be

File tree

235 files changed

+110
-28715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+110
-28715
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Setup Smithy CLI'
2+
description: 'Install Smithy CLI for building the project'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Install Smithy CLI
8+
shell: bash
9+
env:
10+
SMITHY_VERSION: '1.61.0'
11+
run: |
12+
mkdir -p smithy-install/smithy
13+
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
14+
unzip -qo smithy-install/smithy-cli-linux-x86_64.zip -d smithy-install
15+
mv smithy-install/smithy-cli-linux-x86_64/* smithy-install/smithy
16+
sudo smithy-install/smithy/install
17+
smithy --version

.github/workflows/release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: release
3+
run-name: release ${{ inputs.tag }}
4+
5+
on:
6+
push:
7+
branches:
8+
- improvement/CLDSRVCLT-7
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: 'Tag to be released (e.g., 1.0.0)'
13+
required: true
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
release:
20+
name: Build and release
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
cache: 'yarn'
32+
33+
- name: Install dependencies
34+
run: yarn install --frozen-lockfile
35+
36+
- name: Setup Smithy CLI
37+
uses: ./.github/actions/setup-smithy
38+
39+
- name: Build
40+
run: yarn build
41+
42+
- name: Archive build artifacts
43+
run: |
44+
tar -czf cloudserverclient-build.tar.gz dist build/smithy/source/typescript-codegen || tar -czf cloudserverclient-build.tar.gz dist
45+
46+
- name: Upload build artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: cloudserverclient-build
50+
path: cloudserverclient-build.tar.gz
51+
52+
- name: Determine tag
53+
id: tag
54+
run: |
55+
if [ -n "${{ inputs.tag }}" ]; then
56+
echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT
57+
else
58+
echo "tag=test-${{ github.sha }}" >> $GITHUB_OUTPUT
59+
fi
60+
61+
- name: Create GitHub Release
62+
uses: softprops/action-gh-release@v2
63+
with:
64+
tag_name: ${{ steps.tag.outputs.tag }}
65+
name: Release ${{ steps.tag.outputs.tag }}
66+
draft: false
67+
prerelease: false
68+
files: |
69+
cloudserverclient-build.tar.gz
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
- name: Install dependencies
2929
run: yarn install --frozen-lockfile
3030

31+
- name: Setup Smithy CLI
32+
uses: ./.github/actions/setup-smithy
33+
34+
- name: Build
35+
run: yarn build
36+
3137
- name: TypeScript typecheck
3238
run: yarn typecheck
3339

@@ -52,6 +58,12 @@ jobs:
5258
- name: Install dependencies
5359
run: yarn install --frozen-lockfile
5460

61+
- name: Setup Smithy CLI
62+
uses: ./.github/actions/setup-smithy
63+
64+
- name: Build
65+
run: yarn build
66+
5567
- name: Start Cloudserver with MongoDB backend
5668
run: docker compose -f .github/docker-compose.cloudserver-mongo.yml up -d
5769

@@ -85,6 +97,12 @@ jobs:
8597
- name: Install dependencies
8698
run: yarn install --frozen-lockfile
8799

100+
- name: Setup Smithy CLI
101+
uses: ./.github/actions/setup-smithy
102+
103+
- name: Build
104+
run: yarn build
105+
88106
- name: Login to GitHub Container Registry
89107
uses: docker/login-action@v3
90108
with:

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ out
8080

8181
# Nuxt.js build / generate output
8282
.nuxt
83-
# For now, the `dist` folder is commited: so we should not ignore it
84-
#dist
83+
84+
# Build output
85+
build/
86+
dist/
8587

8688
# Gatsby files
8789
.cache/

build/smithy/classpath.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)