Skip to content

Commit 615ca94

Browse files
committed
Initial commit.
0 parents  commit 615ca94

19 files changed

Lines changed: 1368 additions & 0 deletions

.github/scripts/addlicense.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
addlicense -f ./.github/scripts/addlicense_template.txt $@ \
17+
--ignore "**/node_modules/**" \
18+
.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright {{.Year}} Google LLC
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
https://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: CI
16+
on:
17+
push:
18+
branches:
19+
- main
20+
pull_request:
21+
branches:
22+
- main
23+
workflow_call:
24+
25+
jobs:
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 30
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Bun
35+
uses: oven-sh/setup-bun@v1
36+
37+
- name: Install dependencies
38+
run: bun install
39+
40+
- name: Run unit tests
41+
run: bun run test
42+
43+
- name: Run integration tests
44+
run: bun run test:integration
45+
46+
build:
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 30
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
53+
- name: Setup Bun
54+
uses: oven-sh/setup-bun@v1
55+
56+
- name: Install dependencies
57+
run: bun install
58+
59+
- name: Build package
60+
run: bun run build
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Check license headers
16+
on:
17+
pull_request:
18+
push:
19+
branches:
20+
- main
21+
22+
jobs:
23+
check-files-license-headers:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 30
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-go@v5
29+
- name: Install addlicense
30+
run: go install github.com/google/addlicense@latest
31+
- name: Check license header
32+
run: ./.github/scripts/addlicense.sh --check

.github/workflows/publish.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# A workflow that publishes the library to CocoaPods
16+
name: Publish
17+
18+
on:
19+
workflow_call: # called when release-please steps.release.outputs.release_created
20+
workflow_dispatch: # manually trigger if previous runs failed
21+
22+
concurrency:
23+
group: publishing
24+
cancel-in-progress: true
25+
26+
jobs:
27+
build-and-test:
28+
uses: ./.github/workflows/ci.yml
29+
30+
publish:
31+
runs-on: ubuntu-latest
32+
needs: build-and-test
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Node for Dependency Installation
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 20
41+
cache: npm
42+
43+
- name: Install Dependencies
44+
run: npm install --workspaces --include-workspace-root
45+
46+
# Now configure node with the registry used for publishing
47+
- name: Setup Node for Publishing
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: 20
51+
registry-url: 'https://wombat-dressing-room.appspot.com/'
52+
53+
- name: Publish
54+
# npm publish will trigger the build via the prepack hook
55+
run: npm publish --workspaces --include-workspace-root
56+
env:
57+
NODE_AUTH_TOKEN: ${{ secrets.NPM_WOMBOT_TOKEN }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
## Runs the release-please action for all new pushes to the main branch.
16+
## This will create new release-PRs, create GitHub and npm releases,
17+
## and update the CHANGELOG.md.
18+
19+
on:
20+
push:
21+
branches: [main]
22+
workflow_dispatch:
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
permissions:
29+
contents: write
30+
pull-requests: write
31+
32+
name: Release Please
33+
34+
jobs:
35+
build-and-test:
36+
uses: ./.github/workflows/ci.yml
37+
38+
release-please:
39+
runs-on: ubuntu-latest
40+
needs: build-and-test
41+
outputs:
42+
release_ready: ${{ steps.release.outputs.release_created }}
43+
steps:
44+
- id: release
45+
name: Release Please
46+
uses: googleapis/release-please-action@v4
47+
with:
48+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
49+
50+
publish:
51+
needs: release-please
52+
if: ${{ needs.release-please.outputs.release_ready }}
53+
uses: ./.github/workflows/publish.yml
54+
secrets: inherit

0 commit comments

Comments
 (0)