Skip to content

Commit 101daf6

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

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+
16+
17+
jobs:
18+
build-and-tag:
19+
name: Build and tag
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '20'
32+
cache: 'yarn'
33+
34+
- name: Install dependencies
35+
run: yarn install --frozen-lockfile
36+
37+
- name: Setup Smithy CLI
38+
uses: ./.github/actions/setup-smithy
39+
40+
- name: Build project
41+
run: yarn build
42+
43+
- name: Create Tag with Build Artifacts
44+
run: |
45+
# Configure git user to the GitHub Actions bot
46+
git config --global user.name "github-actions[bot]"
47+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
48+
49+
# Force add the build folders (even if they are in .gitignore)
50+
git add -f dist build
51+
52+
# Check if there are changes to commit
53+
if git diff --staged --quiet; then
54+
echo "No changes in build folders or build failed to produce output."
55+
exit 1
56+
fi
57+
58+
# Determine tag name
59+
TAG_NAME="${{ inputs.tag }}"
60+
if [ -z "$TAG_NAME" ]; then
61+
TAG_NAME="test-${{ github.sha }}"
62+
fi
63+
64+
# Commit the build artifacts
65+
git commit -m "Build artifacts for version $TAG_NAME"
66+
67+
# Create the tag
68+
git tag $TAG_NAME
69+
70+
# Push the tag to the repository
71+
git push origin $TAG_NAME

.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)