Skip to content
This repository was archived by the owner on Mar 30, 2026. It is now read-only.

Commit 0dcde85

Browse files
Merge changes from v2.2.0-next.1 into main (#30)
2 parents 034fb5a + a4cdab3 commit 0dcde85

467 files changed

Lines changed: 16149 additions & 12511 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 📝 Annual License Update
2+
3+
on:
4+
# This workflow runs on Jan 1st every year
5+
schedule:
6+
- cron: "0 0 1 1 *"
7+
8+
jobs:
9+
update-license:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # to checkout the code and update the LICENSE file
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
17+
18+
- name: Update Copyright Date Range in LICENSE
19+
run: |
20+
function log_error() { echo '🚨LICENSE UPDATE FAILED🚨'; exit 1; }
21+
22+
year=$(date +%Y)
23+
24+
sed -i -E \
25+
"s/(Copyright © [0-9]{4})-[0-9]{4}(.*)/\1-$year\2/" ./LICENSE || log_error
26+
27+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
28+
git config --global user.name "${{ github.actor }}"
29+
git add ./LICENSE
30+
31+
git commit -m \
32+
"chore(license): update copyright date range to include $year" || log_error
33+
34+
echo 'License Copyright date range successfully updated.'

.github/workflows/cicd.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 🚀 CI/CD Workflow
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize] # default PR types
6+
branches: [main, next]
7+
paths: ["src/**/*", "package*.json"]
8+
push:
9+
branches: [main, next]
10+
paths: ["src/**/*", "package*.json"]
11+
# This workflow can be manually triggered
12+
workflow_dispatch:
13+
14+
jobs:
15+
test:
16+
name: 🧪 Test
17+
uses: ./.github/workflows/test.yaml
18+
secrets: inherit
19+
permissions:
20+
contents: write # to checkout the code and merge bot-PRs
21+
pull-requests: write # to add coverage reports to the PR
22+
statuses: write # to update commit status
23+
24+
release:
25+
name: 📦 Release
26+
needs: test # run job if event=push and tests passed
27+
if: github.event_name == 'push' && needs.test.outputs.success == 'true'
28+
uses: ./.github/workflows/release.yaml
29+
secrets: inherit
30+
permissions:
31+
attestations: write # to generate artifact attestations for dist assets
32+
contents: write # to create a release
33+
issues: write # to be able to comment on released issues

.github/workflows/deploy.yaml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
name: Deploy Workflow
1+
name: 🚀 Deploy Workflow
22

33
on:
4+
# This workflow runs for both releases and pre-releases
45
release: { types: [published] }
56
workflow_dispatch:
67

78
jobs:
89
deploy:
9-
name: Deploy to ECS
10+
name: 🚀 Deploy to ECS
1011
runs-on: ubuntu-latest
11-
12-
# Permissions required to use aws-actions/configure-aws-credentials:
13-
permissions: { id-token: write, contents: read }
14-
12+
permissions:
13+
contents: read # to checkout the code
14+
id-token: write # to assume the OIDC role (configure-aws-credentials)
1515
steps:
1616
- uses: actions/checkout@v4
1717

1818
- uses: docker/setup-buildx-action@v3
1919

20-
- uses: aws-actions/configure-aws-credentials@v4
20+
- name: Configure AWS Credentials for ECR
21+
uses: aws-actions/configure-aws-credentials@v4
2122
with:
2223
role-to-assume: ${{ secrets.ECR_OIDC_GITHUB_ROLE_ARN }}
2324
aws-region: ${{ secrets.ECR_REPO_REGION }}
@@ -36,49 +37,50 @@ jobs:
3637
# 3. env tag (if release: "prod", anything else: "staging")
3738
# 4. relative pointer (if release: "latest", anything else: "next")
3839
run: |
39-
IMAGE_TAGS=( "${{ github.sha }}" )
40+
image_tags=( "${{ github.sha }}" )
4041
4142
if [ "${{ github.event_name }}" == 'release' ]; then
42-
IMAGE_TAGS+=( "${{ github.event.release.tag_name }}" )
43+
image_tags+=( "${{ github.event.release.tag_name }}" )
4344
fi
4445
4546
if [[ "${{ github.event_name }}" == 'release' && "${{ github.event.release.prerelease }}" == 'false' ]]; then
46-
IMAGE_TAGS+=( prod latest )
47+
image_tags+=( prod latest )
4748
else
48-
IMAGE_TAGS+=( staging next )
49+
image_tags+=( staging next )
4950
fi
5051
51-
IMAGE_REPO="${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_PRIVATE_REPO }}"
52-
IMAGE_TAGS=("${IMAGE_TAGS[@]/#/$IMAGE_REPO:}")
52+
image_repo="${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_PRIVATE_REPO }}"
53+
image_tags=("${image_tags[@]/#/$image_repo:}")
5354
54-
docker build ${IMAGE_TAGS[@]/#/--tag } .
55+
docker build ${image_tags[@]/#/--tag } .
5556
56-
for tag in "${IMAGE_TAGS[@]}"; do docker push "$tag"; done
57+
for tag in "${image_tags[@]}"; do docker push "$tag"; done
5758
58-
- uses: aws-actions/configure-aws-credentials@v4
59+
- name: Configure AWS Credentials for ECS
60+
uses: aws-actions/configure-aws-credentials@v4
5961
with:
6062
role-to-assume: ${{ secrets.ECS_OIDC_GITHUB_ROLE_ARN }}
6163
aws-region: ${{ secrets.ECS_CLUSTER_REGION }}
6264

6365
- name: Update ECS Task Definition & Service
6466
run: |
6567
if [[ "${{ github.event_name }}" == 'release' && "${{ github.event.release.prerelease }}" == 'false' ]]; then
66-
TASK_DEF_NAME=${{ secrets.ECS_API_TASK_DEF_PROD }}
67-
SERVICE_NAME=${{ secrets.ECS_API_SERVICE_NAME_PROD }}
68-
CLUSTER_NAME=${{ secrets.ECS_CLUSTER_NAME_PROD }}
68+
task_def_name=${{ secrets.ECS_API_TASK_DEF_PROD }}
69+
service_name=${{ secrets.ECS_API_SERVICE_NAME_PROD }}
70+
cluster_name=${{ secrets.ECS_CLUSTER_NAME_PROD }}
6971
else
70-
TASK_DEF_NAME=${{ secrets.ECS_API_TASK_DEF_STAGING }}
71-
SERVICE_NAME=${{ secrets.ECS_API_SERVICE_NAME_STAGING }}
72-
CLUSTER_NAME=${{ secrets.ECS_CLUSTER_NAME_STAGING }}
72+
task_def_name=${{ secrets.ECS_API_TASK_DEF_STAGING }}
73+
service_name=${{ secrets.ECS_API_SERVICE_NAME_STAGING }}
74+
cluster_name=${{ secrets.ECS_CLUSTER_NAME_STAGING }}
7375
fi
7476
75-
IMAGE_REPO="${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_PRIVATE_REPO }}"
77+
image_repo="${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_PRIVATE_REPO }}"
7678
77-
UPDATED_TASK_DEF_JSON=$(
79+
updated_task_def_json=$(
7880
aws ecs describe-task-definition \
79-
--task-definition $TASK_DEF_NAME \
81+
--task-definition $task_def_name \
8082
--output json | \
81-
jq --arg NEW_IMAGE "$IMAGE_REPO:${{ github.sha }}" \
83+
jq --arg NEW_IMAGE "$image_repo:${{ github.sha }}" \
8284
'.taskDefinition |
8385
.containerDefinitions[0].image = $NEW_IMAGE |
8486
del(.taskDefinitionArn) |
@@ -91,12 +93,12 @@ jobs:
9193
)
9294
9395
aws ecs register-task-definition \
94-
--cli-input-json "$UPDATED_TASK_DEF_JSON" \
96+
--cli-input-json "$updated_task_def_json" \
9597
1>/dev/null
9698
9799
aws ecs update-service \
98-
--cluster $CLUSTER_NAME \
99-
--service $SERVICE_NAME \
100-
--task-definition $TASK_DEF_NAME \
100+
--cluster $cluster_name \
101+
--service $service_name \
102+
--task-definition $task_def_name \
101103
--force-new-deployment \
102104
1>/dev/null
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish API Schema
2+
3+
on:
4+
# This workflow runs for both releases and pre-releases
5+
release: { types: [published] }
6+
# This workflow can be manually triggered
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish-open-api-schema:
11+
name: Publish OpenAPI Schema
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version-file: ".nvmrc"
19+
20+
- name: Setup Publication Tools
21+
run: npm ci --include=dev
22+
23+
- name: Run Publication Script
24+
env:
25+
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
26+
run: |
27+
# If prerelease is false, use --setdefault flag to update the default version
28+
should_set_default=$(
29+
[ ${{ github.event.release.prerelease }} == 'false' ] &&
30+
echo '--setdefault' ||
31+
echo ''
32+
)
33+
34+
scripts/cicd.publish-schema-open-api.sh \
35+
--version=${{ github.event.release.tag_name }} \
36+
$should_set_default
37+
38+
publish-graphql-schema:
39+
name: Publish GraphQL Schema
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version-file: ".nvmrc"
47+
48+
- name: Setup Publication Tools
49+
run: npm ci --include=dev
50+
51+
- name: Run Publication Script
52+
env:
53+
APOLLO_KEY: ${{ secrets.APOLLO_STUDIO_GRAPH_API_KEY }}
54+
run: |
55+
# If prerelease is false, then variant is prod, else variant is staging
56+
graph_variant=$(
57+
[ ${{ github.event.release.prerelease }} == 'false' ] &&
58+
echo prod ||
59+
echo staging
60+
)
61+
62+
scripts/cicd.publish-schema-graphql.sh --variant=$graph_variant

.github/workflows/release.yaml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
1-
name: Release Workflow
2-
3-
# This workflow is called by the Test workflow when all tests pass.
1+
name: 📦 Release Workflow
42

53
on:
6-
workflow_dispatch:
4+
# This workflow is called by the CI/CD Workflow (see ./cicd.yaml)
75
workflow_call:
86
secrets:
97
SEMANTIC_RELEASE_TOKEN: { required: true }
8+
# This workflow can be manually triggered
9+
workflow_dispatch:
1010

1111
jobs:
1212
release:
13-
name: Release
14-
uses: Nerdware-LLC/reusable-action-workflows/.github/workflows/release.yaml@main
15-
secrets:
16-
SEMANTIC_RELEASE_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
13+
name: 📦 Release
14+
runs-on: ubuntu-latest
15+
permissions:
16+
attestations: write # to generate artifact attestations for dist assets
17+
contents: write # to create a release
18+
issues: write # to be able to comment on released issues
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
persist-credentials: false
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version-file: ".nvmrc"
27+
28+
- name: Install Dependencies
29+
run: npm ci --include=dev
30+
31+
- name: Build Dist Assets
32+
run: npm run build
33+
34+
- name: Run Semantic-Release
35+
id: semantic-release
36+
uses: cycjimmy/semantic-release-action@v4
37+
with:
38+
extra_plugins: |
39+
@aensley/semantic-release-openapi@1.1.8
40+
@semantic-release/changelog@6.0.3
41+
@semantic-release/git@10.0.1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}

0 commit comments

Comments
 (0)